From 7547ad0391f71c15961590430ee1ba7ee098810a Mon Sep 17 00:00:00 2001 From: Florent Rougon Date: Wed, 3 Jan 2018 00:34:52 +0100 Subject: [PATCH] Improve formatting of the HAVE_WORKING_STD_REGEX test Indent the test code in a nicer way and shorten it, taking advantage of this guarantee from the C++ standard: If control reaches the end of main without encountering a return statement, the effect is that of executing return 0. -> no need for "#include " nor for "return EXIT_SUCCESS". --- CMakeLists.txt | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f1a0b2a..da7fb268 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -372,20 +372,18 @@ endif() # [3] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78905 check_cxx_source_compiles( "#include - #include -int main() { - #if __cplusplus >= 201103L && \ - (!defined(__GLIBCXX__) || \ - (__cplusplus >= 201402L) || \ - defined(_GLIBCXX_REGEX_DFS_QUANTIFIERS_LIMIT) || \ - defined(_GLIBCXX_REGEX_STATE_LIMIT) || \ - (defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE > 4)) - return EXIT_SUCCESS; - #else - nullptr = void; // intentionally trigger a compilation error - #endif -}" + int main() { + #if __cplusplus >= 201103L && \ + (!defined(__GLIBCXX__) || \ + (__cplusplus >= 201402L) || \ + defined(_GLIBCXX_REGEX_DFS_QUANTIFIERS_LIMIT) || \ + defined(_GLIBCXX_REGEX_STATE_LIMIT) || \ + (defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE > 4)) + #else + nullptr = void; // intentionally trigger a compilation error + #endif + }" HAVE_WORKING_STD_REGEX) if(CMAKE_COMPILER_IS_GNUCXX)