Simplify check for strtoll and strtoq.
authorAndreas Schuh <andreas.schuh.84@gmail.com>
Wed, 19 Mar 2014 15:56:26 +0000 (15:56 +0000)
committerAndreas Schuh <andreas.schuh.84@gmail.com>
Wed, 19 Mar 2014 15:56:26 +0000 (15:56 +0000)
CMakeLists.txt

index fd5bbbe..acb8b44 100644 (file)
@@ -140,10 +140,10 @@ if (MSVC)
   set (HAVE_strtoll 0)
   set (HAVE_strtoq  0)
 else ()
-  foreach (fname IN ITEMS strtoll strtoq)
-    string (TOUPPER "${fname}" FNAME)
-    check_cxx_symbol_exists ("${fname}" stdlib.h HAVE_${FNAME})
-  endforeach ()
+  check_cxx_symbol_exists (strtoll stdlib.h HAVE_STRTOLL)
+  if (NOT HAVE_STRTOLL)
+    check_cxx_symbol_exists (strtoq stdlib.h HAVE_STRTOQ)
+  endif ()
 endif ()
 
 set (CMAKE_THREAD_PREFER_PTHREAD TRUE)