Skip to content

Commit

Permalink
[Fix] Fix detection of libstdc++ for MPT_COMPILER_QUIRK_NO_ALIGNEDALL…
Browse files Browse the repository at this point in the history
…OC. Macro __GLIBCXX__ is available only after we have included some standard library header. Broken since r11643.

git-svn-id: https://source.openmpt.org/svn/openmpt/trunk/OpenMPT@11940 56274372-70c3-4bfc-bfc3-4c3a0b034d27
  • Loading branch information
manxorist committed Aug 24, 2019
1 parent 860457a commit 5925bcf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
16 changes: 16 additions & 0 deletions common/BuildSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,22 @@



// standard library quirks

#if MPT_CXX_AT_LEAST(17)
#if (MPT_COMPILER_GCC || MPT_COMPILER_CLANG)
// we need to detect the standard library via macro __GLIBCXX__
#include <vector>
#endif
#if MPT_COMPILER_MSVC || MPT_GCC_BEFORE(8,1,0) || MPT_CLANG_BEFORE(5,0,0) || (MPT_COMPILER_GCC && defined(__GLIBCXX__) && (defined(__MINGW32__) || defined(__MINGW64__))) || (MPT_COMPILER_CLANG && defined(__GLIBCXX__)) || (MPT_COMPILER_CLANG && MPT_OS_MACOSX_OR_IOS) || MPT_OS_OPENBSD || MPT_OS_EMSCRIPTEN || MPT_OS_HAIKU || (defined(__clang__) && defined(_MSC_VER))
#define MPT_COMPILER_QUIRK_NO_ALIGNEDALLOC
#endif
#endif





// third-party library configuration

#if defined(MODPLUG_TRACKER)
Expand Down
7 changes: 0 additions & 7 deletions common/CompilerDetect.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,13 +308,6 @@
#endif


#if MPT_CXX_AT_LEAST(17)
#if MPT_COMPILER_MSVC || MPT_GCC_BEFORE(8,1,0) || MPT_CLANG_BEFORE(5,0,0) || (MPT_COMPILER_GCC && defined(__GLIBCXX__) && (defined(__MINGW32__) || defined(__MINGW64__))) || (MPT_COMPILER_CLANG && defined(__GLIBCXX__)) || (MPT_COMPILER_CLANG && MPT_OS_MACOSX_OR_IOS) || MPT_OS_OPENBSD || MPT_OS_EMSCRIPTEN || MPT_OS_HAIKU || (defined(__clang__) && defined(_MSC_VER))
#define MPT_COMPILER_QUIRK_NO_ALIGNEDALLOC
#endif
#endif


#if MPT_GCC_BEFORE(6,1,0)
#define MPT_COMPILER_QUIRK_NO_CONSTEXPR14_THROW
#endif
Expand Down

0 comments on commit 5925bcf

Please sign in to comment.