diff --git a/lib/if2ip.c b/lib/if2ip.c
index e9b8a4955..5fa70a68c 100644
--- a/lib/if2ip.c
+++ b/lib/if2ip.c
@@ -66,7 +66,7 @@
 #include <netdb.h>
 #endif
 
-#include HAVE_SYS_TIME_H
+#ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
 #endif