When checking for floorl(), include math.h.

It's not being found with MSVC, but is apparently present; perhaps
math.h does something magic, e.g. defining it as a macro, so try using
check_symbol_exists with "math.h".

Change-Id: Idaecac641fb0b87d399807d8bf1fcb74e7251a4e
Reviewed-on: https://code.wireshark.org/review/5911
Reviewed-by: Guy Harris <guy@alum.mit.edu>
This commit is contained in:
Guy Harris 2014-12-20 00:23:05 -08:00
parent 4b8639f049
commit a61f6e4745
1 changed files with 6 additions and 2 deletions

View File

@ -63,6 +63,7 @@ check_include_file("winsock2.h" HAVE_WINSOCK2_H)
#Functions
include(CheckFunctionExists)
include(CheckSymbolExists)
check_function_exists("chown" HAVE_CHOWN)
cmake_push_check_state()
@ -79,7 +80,11 @@ set(CMAKE_REQUIRED_LIBRARIES %{CMAKE_DL_LIBS})
check_function_exists("dladdr" HAVE_DLADDR)
cmake_pop_check_state()
check_function_exists("floorl" HAVE_FLOORL)
#
# Use check_symbol_exists just in case math.h does something magic
# and there's not actually a function named floorl()
#
check_symbol_exists("floorl" "math.h" HAVE_FLOORL)
check_function_exists("gethostbyname2" HAVE_GETHOSTBYNAME2)
check_function_exists("getopt" HAVE_GETOPT)
check_function_exists("getprotobynumber" HAVE_GETPROTOBYNUMBER)
@ -108,7 +113,6 @@ check_struct_has_member("struct stat" st_flags sys/stat.h HAVE_ST_FLAGS)
check_struct_has_member("struct tm" tm_zone time.h HAVE_TM_ZONE)
#Symbols but NOT enums or types
include(CheckSymbolExists)
check_symbol_exists(tzname "time.h" HAVE_TZNAME)
# Check for stuff that isn't testable via the tests above