summaryrefslogtreecommitdiff
path: root/include/openvswitch/compiler.h
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2017-07-31 13:31:43 -0700
committerBen Pfaff <blp@ovn.org>2017-07-31 16:03:38 -0700
commit994bfc298502e6f9178dd231c569a6b305a8299f (patch)
treefa438d31d34e983b0cc2dd81903970be6d4d5859 /include/openvswitch/compiler.h
parent4d617a87ec0be851a5a0d8f7f99ffb237a0ef397 (diff)
downloadopenvswitch-994bfc298502e6f9178dd231c569a6b305a8299f.tar.gz
Automatically verify that OVS header files work OK in C++ also.
This should help address a recurring problem. This change makes the OVS header files, when parsed by a C++ compiler, require C++11 or later. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Russell Bryant <russell@ovn.org>
Diffstat (limited to 'include/openvswitch/compiler.h')
-rw-r--r--include/openvswitch/compiler.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/openvswitch/compiler.h b/include/openvswitch/compiler.h
index 0dc8636ad..0076ad763 100644
--- a/include/openvswitch/compiler.h
+++ b/include/openvswitch/compiler.h
@@ -244,9 +244,8 @@
#define BUILD_ASSERT(EXPR) ((void) 0)
#define BUILD_ASSERT_DECL(EXPR) extern int (*build_assert(void))[1]
#elif defined(__cplusplus)
-#include <boost/static_assert.hpp>
-#define BUILD_ASSERT BOOST_STATIC_ASSERT
-#define BUILD_ASSERT_DECL BOOST_STATIC_ASSERT
+#define BUILD_ASSERT(EXPR) static_assert(EXPR, "assertion failed")
+#define BUILD_ASSERT_DECL(EXPR) static_assert(EXPR, "assertion failed")
#elif (__GNUC__ * 256 + __GNUC_MINOR__ >= 0x403 \
|| __has_extension(c_static_assert))
#define BUILD_ASSERT_DECL(EXPR) _Static_assert(EXPR, #EXPR)