forked from Mirrors/openclonk
Check for static_assert support
parent
b620bc24cf
commit
ff2e4e05b0
|
@ -73,6 +73,7 @@ if(HAVE_NULLPTR)
|
|||
CHECK_CXX_SOURCE_COMPILES("#include <cstddef>
|
||||
template<class T> void f(T &&); template<> void f(std::nullptr_t &&) {} int main() { f(NULL); }" NULL_IS_NULLPTR_T)
|
||||
endif()
|
||||
CHECK_CXX_SOURCE_COMPILES("int main() { static_assert(true, \"\"); }" HAVE_STATIC_ASSERT)
|
||||
|
||||
if(MSVC_VERSION GREATER 1499)
|
||||
# Activate minimal rebuild
|
||||
|
|
|
@ -191,3 +191,6 @@
|
|||
/* Define to 1 if your NULL is an instance of std::nullptr_t. */
|
||||
#cmakedefine NULL_IS_NULLPTR_T 1
|
||||
|
||||
/* Define to 1 if your compiler supports static_assert */
|
||||
#cmakedefine HAVE_STATIC_ASSERT 1
|
||||
|
||||
|
|
|
@ -136,6 +136,13 @@ typedef ptrdiff_t ssize_t;
|
|||
|
||||
|
||||
|
||||
#ifndef HAVE_STATIC_ASSERT
|
||||
#include <boost/static_assert.hpp>
|
||||
#define static_assert(x, y) BOOST_STATIC_ASSERT(x)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if defined(__GNUC__)
|
||||
// Allow checks for correct printf-usage
|
||||
#define GNUC_FORMAT_ATTRIBUTE __attribute__ ((format (printf, 1, 2)))
|
||||
|
|
Loading…
Reference in New Issue