Skip to content

Commit f1e7d4a

Browse files
committed
test(timeout): include guards
1 parent a9947e1 commit f1e7d4a

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ if(NOT MEMCACHED_BINARY)
4646
endif()
4747

4848
add_executable(timeout timeout.c)
49+
target_include_directories(timeout PRIVATE ${CMAKE_BINARY_DIR})
4950

5051
file(GLOB_RECURSE TESTING_SRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp)
5152
set(TESTING_ROOT "${CMAKE_CURRENT_BINARY_DIR}")

test/timeout.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1+
#include "mem_config.h"
12
#include <unistd.h>
23
#include <stdio.h>
34
#include <stdlib.h>
45
#include <memory.h>
5-
#include <arpa/inet.h>
6-
#include <sys/socket.h>
6+
#if HAVE_ARPA_INET_H
7+
# include <arpa/inet.h>
8+
#endif
9+
#if HAVE_SYS_SOCKET_H
10+
# include <sys/socket.h>
11+
#endif
12+
#if HAVE_NETINET_IN_H
13+
# include <netinet/in.h>
14+
#endif
715

816
// $0 -u nobody -p <port>
917
int main(int argc, char **argv) {

0 commit comments

Comments
 (0)