forked from Mirrors/openclonk
Check for static_assert support
parent
19ae7b244d
commit
62f840412e
|
@ -73,6 +73,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
|||
list(APPEND OC_CXX_FLAGS "-std=gnu++0x")
|
||||
endif()
|
||||
endif()
|
||||
CHECK_CXX_SOURCE_COMPILES("int main() { static_assert(true, \"\"); }" HAVE_STATIC_ASSERT)
|
||||
|
||||
# ck 09-09-20: CMAKE_REQUIRED_FLAGS requires a string, not a list.
|
||||
include(CheckCXXSourceCompiles)
|
||||
|
|
|
@ -203,5 +203,8 @@
|
|||
/* Use Apple Cocoa for the UI */
|
||||
#cmakedefine USE_COCOA 1
|
||||
|
||||
/* Define to 1 if your compiler supports static_assert */
|
||||
#cmakedefine HAVE_STATIC_ASSERT 1
|
||||
|
||||
/* Generate minidumps on crash */
|
||||
#cmakedefine GENERATE_MINI_DUMP 1
|
||||
|
|
|
@ -117,6 +117,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