diff --git a/cmake/Libraries.cmake b/cmake/Libraries.cmake index 61da376be..2698f4ef3 100644 --- a/cmake/Libraries.cmake +++ b/cmake/Libraries.cmake @@ -83,7 +83,12 @@ macro(configure_unix_libs) include(CheckCSourceCompiles) check_include_files(sys/socket.h HAVE_SYS_SOCKET_H) + + check_include_files(unistd.h HAVE_UNISTD_H) + if (NOT HAVE_UNISTD_H) + message(FATAL_ERROR "Missing unistd.h") + endif() check_function_exists(sigwait HAVE_POSIX_SIGWAIT) check_function_exists(inet_aton HAVE_INET_ATON) diff --git a/src/lib/Config.h.in b/src/lib/Config.h.in index 0b93f3f58..7ed0acf0d 100644 --- a/src/lib/Config.h.in +++ b/src/lib/Config.h.in @@ -31,9 +31,6 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_TYPES_H @HAVE_SYS_TYPES_H@ -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_UNISTD_H @HAVE_UNISTD_H@ - /* Define to 1 if you have the header file. */ #cmakedefine HAVE_X11_EXTENSIONS_XRANDR_H @HAVE_X11_EXTENSIONS_XRANDR_H@ diff --git a/src/lib/arch/unix/ArchNetworkBSD.cpp b/src/lib/arch/unix/ArchNetworkBSD.cpp index f08632d4d..a450bd115 100644 --- a/src/lib/arch/unix/ArchNetworkBSD.cpp +++ b/src/lib/arch/unix/ArchNetworkBSD.cpp @@ -18,10 +18,7 @@ #include #include #include - -#if HAVE_UNISTD_H #include -#endif #if !defined(TCP_NODELAY) #include diff --git a/src/lib/platform/XWindowsEventQueueBuffer.cpp b/src/lib/platform/XWindowsEventQueueBuffer.cpp index 36732c7c9..23111572b 100644 --- a/src/lib/platform/XWindowsEventQueueBuffer.cpp +++ b/src/lib/platform/XWindowsEventQueueBuffer.cpp @@ -13,11 +13,8 @@ #include "mt/Thread.h" #include -#if HAVE_UNISTD_H -#include -#endif - #include +#include // // EventQueueTimer