From 51f11789214d784d76a0c38c5e57c8cd54dfec9c Mon Sep 17 00:00:00 2001 From: Nikita Kniazev Date: Sat, 24 Feb 2018 20:17:36 +0300 Subject: [PATCH 1/5] BOOST_STATIC_CONSTANT should use constexpr --- include/boost/config/detail/suffix.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/config/detail/suffix.hpp b/include/boost/config/detail/suffix.hpp index 22d31f68..2e5b942b 100644 --- a/include/boost/config/detail/suffix.hpp +++ b/include/boost/config/detail/suffix.hpp @@ -391,7 +391,7 @@ namespace std { # ifdef BOOST_NO_INCLASS_MEMBER_INITIALIZATION # define BOOST_STATIC_CONSTANT(type, assignment) enum { assignment } # else -# define BOOST_STATIC_CONSTANT(type, assignment) static const type assignment +# define BOOST_STATIC_CONSTANT(type, assignment) BOOST_STATIC_CONSTEXPR type assignment # endif // BOOST_USE_FACET / HAS_FACET workaround ----------------------------------// From 3b709bc3edd331c114b0cce7f030441e032fa146 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Sun, 11 Mar 2018 17:37:13 +0300 Subject: [PATCH 2/5] Use dllimport/dllexport with clang and gcc on Cygwin. This is required at least for Boost.WinAPI to match the declarations in Windows SDK headers, which use dllimport. Also, for clang on Windows, use dllimport/dllexport even beyond Cygwin. The compiler does support these attributes, and it should for compatibility with Windows headers. --- include/boost/config/compiler/clang.hpp | 8 ++++++-- include/boost/config/compiler/gcc.hpp | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/boost/config/compiler/clang.hpp b/include/boost/config/compiler/clang.hpp index 0fdf331f..da736bc4 100644 --- a/include/boost/config/compiler/clang.hpp +++ b/include/boost/config/compiler/clang.hpp @@ -98,11 +98,15 @@ // // Dynamic shared object (DSO) and dynamic-link library (DLL) support // -#if !defined(_WIN32) && !defined(__WIN32__) && !defined(WIN32) +#if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__) +# define BOOST_HAS_DECLSPEC +# define BOOST_SYMBOL_EXPORT __attribute__((__dllexport__)) +# define BOOST_SYMBOL_IMPORT __attribute__((__dllimport__)) +#else # define BOOST_SYMBOL_EXPORT __attribute__((__visibility__("default"))) # define BOOST_SYMBOL_IMPORT -# define BOOST_SYMBOL_VISIBLE __attribute__((__visibility__("default"))) #endif +#define BOOST_SYMBOL_VISIBLE __attribute__((__visibility__("default"))) // // The BOOST_FALLTHROUGH macro can be used to annotate implicit fall-through diff --git a/include/boost/config/compiler/gcc.hpp b/include/boost/config/compiler/gcc.hpp index 8296520a..4fe968a0 100644 --- a/include/boost/config/compiler/gcc.hpp +++ b/include/boost/config/compiler/gcc.hpp @@ -99,10 +99,10 @@ // Dynamic shared object (DSO) and dynamic-link library (DLL) support // #if __GNUC__ >= 4 -# if (defined(_WIN32) || defined(__WIN32__) || defined(WIN32)) && !defined(__CYGWIN__) +# if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__) // All Win32 development environments, including 64-bit Windows and MinGW, define // _WIN32 or one of its variant spellings. Note that Cygwin is a POSIX environment, - // so does not define _WIN32 or its variants. + // so does not define _WIN32 or its variants, but still supports dllexport/dllimport. # define BOOST_HAS_DECLSPEC # define BOOST_SYMBOL_EXPORT __attribute__((__dllexport__)) # define BOOST_SYMBOL_IMPORT __attribute__((__dllimport__)) From 3cf434c002c793ec568737687613110252215686 Mon Sep 17 00:00:00 2001 From: Daniel James Date: Sun, 11 Mar 2018 21:12:53 +0000 Subject: [PATCH 3/5] Undefine BOOST_GCC for intel compilers Otherwise it's just defined as BOOST_GCC_VERSION. --- include/boost/config/compiler/intel.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/boost/config/compiler/intel.hpp b/include/boost/config/compiler/intel.hpp index 00396b03..0eea05b9 100644 --- a/include/boost/config/compiler/intel.hpp +++ b/include/boost/config/compiler/intel.hpp @@ -45,6 +45,7 @@ #undef BOOST_GCC_VERSION #undef BOOST_GCC_CXX11 +#undef BOOST_GCC // Broken in all versions up to 17 (newer versions not tested) #if (__INTEL_COMPILER <= 1700) && !defined(BOOST_NO_CXX14_CONSTEXPR) From dca252c0870361a0ab52b247eeaa450a26e4f5dd Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Fri, 16 Mar 2018 18:10:43 +0000 Subject: [PATCH 4/5] cstdint.hpp: Move the #pragma system_header to catch more cases. See https://github.com/boostorg/config/issues/190. --- include/boost/cstdint.hpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/include/boost/cstdint.hpp b/include/boost/cstdint.hpp index 0b169132..c8474c46 100644 --- a/include/boost/cstdint.hpp +++ b/include/boost/cstdint.hpp @@ -34,6 +34,17 @@ #endif #include +// +// For the following code we get several warnings along the lines of: +// +// boost/cstdint.hpp:428:35: error: use of C99 long long integer constant +// +// So we declare this a system header to suppress these warnings. +// See also https://github.com/boostorg/config/issues/190 +// +#if defined(__GNUC__) && (__GNUC__ >= 4) +#pragma GCC system_header +#endif // // Note that GLIBC is a bit inconsistent about whether int64_t is defined or not @@ -408,16 +419,6 @@ INT#_C macros if they're not already defined (John Maddock). #if !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && \ (!defined(INT8_C) || !defined(INT16_C) || !defined(INT32_C) || !defined(INT64_C)) // -// For the following code we get several warnings along the lines of: -// -// boost/cstdint.hpp:428:35: error: use of C99 long long integer constant -// -// So we declare this a system header to suppress these warnings. -// -#if defined(__GNUC__) && (__GNUC__ >= 4) -#pragma GCC system_header -#endif -// // Undef the macros as a precaution, since we may get here if has failed // to define them all, see https://svn.boost.org/trac/boost/ticket/12786 // From d9d5ece1c8a0c1fded2afd64e2643f791d3d4c53 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sun, 18 Mar 2018 10:53:41 +0000 Subject: [PATCH 5/5] Revert "BOOST_STATIC_CONSTANT should use constexpr" This reverts commit 51f11789214d784d76a0c38c5e57c8cd54dfec9c. --- include/boost/config/detail/suffix.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/config/detail/suffix.hpp b/include/boost/config/detail/suffix.hpp index 2e5b942b..22d31f68 100644 --- a/include/boost/config/detail/suffix.hpp +++ b/include/boost/config/detail/suffix.hpp @@ -391,7 +391,7 @@ namespace std { # ifdef BOOST_NO_INCLASS_MEMBER_INITIALIZATION # define BOOST_STATIC_CONSTANT(type, assignment) enum { assignment } # else -# define BOOST_STATIC_CONSTANT(type, assignment) BOOST_STATIC_CONSTEXPR type assignment +# define BOOST_STATIC_CONSTANT(type, assignment) static const type assignment # endif // BOOST_USE_FACET / HAS_FACET workaround ----------------------------------//