]> git.lyx.org Git - lyx.git/blobdiff - 3rdparty/boost/boost/static_assert.hpp
Remove python warning
[lyx.git] / 3rdparty / boost / boost / static_assert.hpp
index d083a9c37d8042fe0cf6e28f4c6e73926de6e85c..0c9c5a5fd260f6f971702cc29fa92749ecb154b9 100644 (file)
 #  ifndef BOOST_NO_CXX11_VARIADIC_MACROS
 #     define BOOST_STATIC_ASSERT_MSG( ... ) static_assert(__VA_ARGS__)
 #  else
-#     define BOOST_STATIC_ASSERT_MSG( B, Msg ) BOOST_STATIC_ASSERT( B )
+#     define BOOST_STATIC_ASSERT_MSG( B, Msg ) static_assert( B, Msg )
 #  endif
 #else
 #     define BOOST_STATIC_ASSERT_MSG( B, Msg ) BOOST_STATIC_ASSERT( B )
 #endif
 
-#ifdef __BORLANDC__
+#ifdef BOOST_BORLANDC
 //
 // workaround for buggy integral-constant expression support:
 #define BOOST_BUGGY_INTEGRAL_CONSTANT_EXPRESSIONS
@@ -53,9 +53,9 @@
 //
 #if defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4)))
 #  ifndef BOOST_NO_CXX11_VARIADIC_MACROS
-#     define BOOST_STATIC_ASSERT_BOOL_CAST( ... ) ((__VA_ARGS__) == 0 ? false : true)
+#     define BOOST_STATIC_ASSERT_BOOL_CAST( ... ) ((__VA_ARGS__) != 0)
 #  else
-#     define BOOST_STATIC_ASSERT_BOOL_CAST( x ) ((x) == 0 ? false : true)
+#     define BOOST_STATIC_ASSERT_BOOL_CAST( x ) ((x) != 0)
 #  endif
 #else
 #  ifndef BOOST_NO_CXX11_VARIADIC_MACROS
 #     define BOOST_STATIC_ASSERT_BOOL_CAST(x) (bool)(x)
 #  endif
 #endif
-//
-// If the compiler warns about unused typedefs then enable this:
-//
-#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)))
-#  define BOOST_STATIC_ASSERT_UNUSED_ATTRIBUTE __attribute__((unused))
-#else
-#  define BOOST_STATIC_ASSERT_UNUSED_ATTRIBUTE
-#endif
 
 #ifndef BOOST_NO_CXX11_STATIC_ASSERT
 #  ifndef BOOST_NO_CXX11_VARIADIC_MACROS
@@ -117,14 +109,7 @@ template<int x> struct static_assert_test{};
 //
 #if !defined(BOOST_BUGGY_INTEGRAL_CONSTANT_EXPRESSIONS)
 
-#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
-// __LINE__ macro broken when -ZI is used see Q199057
-// fortunately MSVC ignores duplicate typedef's.
-#define BOOST_STATIC_ASSERT( B ) \
-   typedef ::boost::static_assert_test<\
-      sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >)\
-      > boost_static_assert_typedef_
-#elif defined(BOOST_MSVC) && defined(BOOST_NO_CXX11_VARIADIC_MACROS)
+#if defined(BOOST_MSVC) && defined(BOOST_NO_CXX11_VARIADIC_MACROS)
 #define BOOST_STATIC_ASSERT( B ) \
    typedef ::boost::static_assert_test<\
       sizeof(::boost::STATIC_ASSERTION_FAILURE< BOOST_STATIC_ASSERT_BOOL_CAST ( B ) >)>\
@@ -167,12 +152,12 @@ template<int x> struct static_assert_test{};
 #     define BOOST_STATIC_ASSERT( ... ) \
          typedef ::boost::static_assert_test<\
             sizeof(::boost::STATIC_ASSERTION_FAILURE< BOOST_STATIC_ASSERT_BOOL_CAST( __VA_ARGS__ ) >)>\
-               BOOST_JOIN(boost_static_assert_typedef_, __LINE__) BOOST_STATIC_ASSERT_UNUSED_ATTRIBUTE
+               BOOST_JOIN(boost_static_assert_typedef_, __LINE__) BOOST_ATTRIBUTE_UNUSED
 #  else
 #     define BOOST_STATIC_ASSERT( B ) \
          typedef ::boost::static_assert_test<\
             sizeof(::boost::STATIC_ASSERTION_FAILURE< BOOST_STATIC_ASSERT_BOOL_CAST( B ) >)>\
-               BOOST_JOIN(boost_static_assert_typedef_, __LINE__) BOOST_STATIC_ASSERT_UNUSED_ATTRIBUTE
+               BOOST_JOIN(boost_static_assert_typedef_, __LINE__) BOOST_ATTRIBUTE_UNUSED
 #  endif
 #endif