From 74422e476b91643a6bea132bec78e580b6c45f2e Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Wed, 2 Jan 2019 14:05:06 -0600 Subject: [PATCH] Define _GNU_SOURCE for wcstod_l check --- cmake/ConfigureChecks.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake index 265a96127..e4fc14039 100644 --- a/cmake/ConfigureChecks.cmake +++ b/cmake/ConfigureChecks.cmake @@ -33,6 +33,7 @@ INCLUDE(CheckIncludeFiles) INCLUDE(CheckStructHasMember) INCLUDE(CheckCXXSourceCompiles) INCLUDE(CheckTypeSize) +INCLUDE(CMakePushCheckState) CHECK_CXX_SYMBOL_EXISTS(backtrace_symbols execinfo.h HAVE_BACKTRACE_SYMBOLS) CHECK_CXX_SYMBOL_EXISTS(clock_gettime time.h HAVE_CLOCK_GETTIME) CHECK_CXX_SYMBOL_EXISTS(ctermid_r stdio.h HAVE_CTERMID_R) @@ -77,7 +78,12 @@ CHECK_CXX_SYMBOL_EXISTS(wcsdup wchar.h HAVE_WCSDUP) CHECK_CXX_SYMBOL_EXISTS(wcslcpy wchar.h HAVE_WCSLCPY) CHECK_CXX_SYMBOL_EXISTS(wcsncasecmp wchar.h HAVE_WCSNCASECMP) CHECK_CXX_SYMBOL_EXISTS(wcsndup wchar.h HAVE_WCSNDUP) + +CMAKE_PUSH_CHECK_STATE(RESET) +# wcstod_l is a GNU-extension, sometimes hidden behind the following define +LIST(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE=1) CHECK_CXX_SYMBOL_EXISTS(wcstod_l "wchar.h;xlocale.h" HAVE_WCSTOD_L) +CMAKE_POP_CHECK_STATE() CHECK_CXX_SYMBOL_EXISTS(_sys_errs stdlib.h HAVE__SYS__ERRS)