about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--ext/raindrops/extconf.rb1
-rw-r--r--ext/raindrops/linux_tcp_info.c4
2 files changed, 3 insertions, 2 deletions
diff --git a/ext/raindrops/extconf.rb b/ext/raindrops/extconf.rb
index f012808..74ed8f9 100644
--- a/ext/raindrops/extconf.rb
+++ b/ext/raindrops/extconf.rb
@@ -6,6 +6,7 @@ have_func('munmap', 'sys/mman.h') or abort 'munmap() not found'
 
 $CPPFLAGS += " -D_GNU_SOURCE "
 have_func('mremap', 'sys/mman.h')
+have_header('linux/tcp.h')
 
 $CPPFLAGS += " -D_BSD_SOURCE "
 have_func("getpagesize", "unistd.h")
diff --git a/ext/raindrops/linux_tcp_info.c b/ext/raindrops/linux_tcp_info.c
index dcdb153..5e25d4d 100644
--- a/ext/raindrops/linux_tcp_info.c
+++ b/ext/raindrops/linux_tcp_info.c
@@ -1,4 +1,4 @@
-#ifdef __linux__
+#if defined(__linux__) && defined(HAVE_LINUX_TCP_H)
 #include <ruby.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
@@ -170,4 +170,4 @@ void Init_raindrops_linux_tcp_info(void)
         TCPI_DEFINE_METHOD(total_retrans);
 }
 #endif /* TCP_INFO */
-#endif /* __linux__ */
+#endif /* defined(__linux__) && defined(HAVE_LINUX_TCP_H) */