Skip to content
Snippets Groups Projects
Commit 00550414 authored by Nick Zavaritsky's avatar Nick Zavaritsky
Browse files

gh-1019: Fix FreeBSD 10 build issue with gcc4.8

Issue was due to _Thread_local keyword used in the system
header which gcc4.8 fails to understand in c11 mode.
In --std=gnu99 mode it works.

Updated cmake test to claim no c11 support if ctype.h fails
to compile.
parent f08ee562
No related branches found
No related tags found
No related merge requests found
......@@ -41,7 +41,14 @@ endif()
if((NOT HAVE_STD_C11 AND NOT HAVE_STD_GNU99) OR
(NOT HAVE_STD_CXX11 AND NOT HAVE_STD_GNUXX0X))
set(CMAKE_REQUIRED_FLAGS "-std=c11")
check_c_source_compiles("int main(void) { return 0; }" HAVE_STD_C11)
check_c_source_compiles("
/*
* FreeBSD 10 ctype.h header fail to compile on gcc4.8 in c11 mode.
* Make sure we aren't affected.
*/
#include <ctype.h>
int main(void) { return 0; }
" HAVE_STD_C11)
set(CMAKE_REQUIRED_FLAGS "-std=gnu99")
check_c_source_compiles("int main(void) { return 0; }" HAVE_STD_GNU99)
set(CMAKE_REQUIRED_FLAGS "-std=c++11")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment