test(timeout): include guards
authorMichael Wallner <mike@php.net>
Mon, 13 Sep 2021 12:20:55 +0000 (14:20 +0200)
committerMichael Wallner <mike@php.net>
Mon, 13 Sep 2021 12:20:55 +0000 (14:20 +0200)
test/CMakeLists.txt
test/timeout.c

index 523db5be19219081582570fdddbbc472ce4913d0..b9ce01aef72ca84db4eaba55ea3ec066e4b30c7e 100644 (file)
@@ -46,6 +46,7 @@ if(NOT MEMCACHED_BINARY)
 endif()
 
 add_executable(timeout timeout.c)
+target_include_directories(timeout PRIVATE ${CMAKE_BINARY_DIR})
 
 file(GLOB_RECURSE TESTING_SRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp)
 set(TESTING_ROOT "${CMAKE_CURRENT_BINARY_DIR}")
index e3c59a3a691ec521e4fa5efc31987a6657f896ad..000aa12eb3f330cfdadbe01bcd6bf42aa60e851f 100644 (file)
@@ -1,9 +1,17 @@
+#include "mem_config.h"
 #include <unistd.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <memory.h>
-#include <arpa/inet.h>
-#include <sys/socket.h>
+#if HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
+#if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+#if HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
 
 // $0 -u nobody -p <port>
 int main(int argc, char **argv) {