Merge pull request #28 from apolukhin/develop

Added BOOST_HAS_PRAGMA_DETECT_MISSMATCH macro
This commit is contained in:
jzmaddock
2014-08-19 17:53:53 +01:00
3 changed files with 20 additions and 0 deletions

View File

@ -399,6 +399,13 @@ containing header should be included only once while preprocessing the
current translation unit. The pragma may improve compile times of large projects current translation unit. The pragma may improve compile times of large projects
with some compilers. with some compilers.
]] ]]
[[`BOOST_HAS_PRAGMA_DETECT_MISSMATCH`][Compiler][
The compiler recognizes the `#pragma detect_mismatch("name", "value")` directive which tells that the
link stage should be terminated with error if values for provided `"name"` missmatch.
This pragma may be a help in preventing ODR violations and ensuring that different modules
are compiled with same flags.
]]
[[`BOOST_HAS_PTHREAD_DELAY_NP`][Platform][ [[`BOOST_HAS_PTHREAD_DELAY_NP`][Platform][
The platform has the POSIX API `pthread_delay_np`. The platform has the POSIX API `pthread_delay_np`.
]] ]]

View File

@ -10,6 +10,15 @@
#define BOOST_HAS_PRAGMA_ONCE #define BOOST_HAS_PRAGMA_ONCE
// Detecting `-fms-extension` compiler flag assuming that _MSC_VER defined when that flag is used.
#if defined (_MSC_VER) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 4))
// Ignoring the checks on APPLE platform because someone made __clang_major__ equal to
// LLVM version rather than compiler version.
# ifndef __APPLE__
# define BOOST_HAS_PRAGMA_DETECT_MISSMATCH
# endif
#endif
// When compiling with clang before __has_extension was defined, // When compiling with clang before __has_extension was defined,
// even if one writes 'defined(__has_extension) && __has_extension(xxx)', // even if one writes 'defined(__has_extension) && __has_extension(xxx)',
// clang reports a compiler error. So the only workaround found is: // clang reports a compiler error. So the only workaround found is:

View File

@ -36,6 +36,9 @@
#define BOOST_HAS_PRAGMA_ONCE #define BOOST_HAS_PRAGMA_ONCE
// Will be undefined for old compilers lower in this file
#define BOOST_HAS_PRAGMA_DETECT_MISSMATCH
// //
// versions check: // versions check:
// we don't support Visual C++ prior to version 7.1: // we don't support Visual C++ prior to version 7.1:
@ -59,6 +62,7 @@
#if _MSC_VER < 1500 // 140X == VC++ 8.0 #if _MSC_VER < 1500 // 140X == VC++ 8.0
# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
# undef BOOST_HAS_PRAGMA_DETECT_MISSMATCH
#endif #endif
#if _MSC_VER < 1600 // 150X == VC++ 9.0 #if _MSC_VER < 1600 // 150X == VC++ 9.0