mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-24 12:14:26 +00:00
Use static_assert more actively
This commit is contained in:
parent
0fc15d48f3
commit
43b9fefbd2
@ -128,6 +128,13 @@ endif ()
|
||||
# add_definitions(-DFMT_USE_DELETED_FUNCTIONS=1)
|
||||
#endif ()
|
||||
|
||||
#check_cxx_source_compiles("
|
||||
# static_assert(true, \"\");
|
||||
# int main(){}" FMT_STATIC_ASSERT)
|
||||
#if (FMT_STATIC_ASSERT)
|
||||
# add_definitions(-DFMT_USE_STATIC_ASSERT=1)
|
||||
#endif ()
|
||||
|
||||
# GTest doesn't detect <tuple> with clang.
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
target_compile_definitions(gmock PUBLIC GTEST_USE_OWN_TR1_TUPLE=1)
|
||||
|
3
posix.h
3
posix.h
@ -68,7 +68,8 @@
|
||||
# define FMT_UNUSED
|
||||
#endif
|
||||
|
||||
#if FMT_USE_STATIC_ASSERT
|
||||
#if FMT_USE_STATIC_ASSERT || FMT_HAS_CPP_ATTRIBUTE(cxx_static_assert) || \
|
||||
(FMT_GCC_VERSION >= 403 && __cplusplus >= 201103) || _MSC_VER >= 1600
|
||||
# define FMT_STATIC_ASSERT(cond, message) static_assert(cond, message)
|
||||
#else
|
||||
# define FMT_CONCAT_(a, b) FMT_CONCAT(a, b)
|
||||
|
Loading…
Reference in New Issue
Block a user