# Generate config.h
include(CheckIncludeFiles)
include(CheckFunctionExists)
-set(CMAKE_EXTRA_INCLUDE_FILES winsock2.h)
-set(CMAKE_REQUIRED_LIBRARIES ws2_32)
+include(CheckTypeSize)
+if(WIN32)
+ set(CMAKE_EXTRA_INCLUDE_FILES winsock2.h)
+ set(CMAKE_REQUIRED_LIBRARIES ws2_32)
+endif()
check_function_exists(inet_aton HAVE_INET_ATON)
check_function_exists(inet_ntop HAVE_INET_NTOP)
+set(CMAKE_EXTRA_INCLUDE_FILES sys/socket.h)
+check_type_size(socklen_t SOCKLEN_T)
+
set(CMAKE_EXTRA_INCLUDE_FILES)
set(CMAKE_REQUIRED_LIBRARIES)
check_function_exists(snprintf HAVE_SNPRINTF)
+#cmakedefine HAVE_SOCKLEN_T
#cmakedefine HAVE_INET_ATON
#cmakedefine HAVE_INET_NTOP
#cmakedefine HAVE_SNPRINTF