about summary refs log tree commit homepage
path: root/ext/raindrops/raindrops.c
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2017-03-16 03:16:51 +0000
committerEric Wong <e@80x24.org>2017-03-17 22:39:11 +0000
commit17d57231c4d9d3dfb486b6d37b85d57e6065958e (patch)
tree2ddee320f6d3b11b1cbdf9f3c65c3c52e96bdd15 /ext/raindrops/raindrops.c
parent8d9f163a159a1366a86ba166142b4f6f3fd38083 (diff)
downloadraindrops-17d57231c4d9d3dfb486b6d37b85d57e6065958e.tar.gz
Of course these fields are not portable between Linux and FreeBSD,
but they should remain ABI-compatible for future versions of each OS.

Tested on FreeBSD 10.3-RELEASE i386

TCP state names will be another problem...
Diffstat (limited to 'ext/raindrops/raindrops.c')
-rw-r--r--ext/raindrops/raindrops.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/raindrops/raindrops.c b/ext/raindrops/raindrops.c
index 390b8b8..0ea3e32 100644
--- a/ext/raindrops/raindrops.c
+++ b/ext/raindrops/raindrops.c
@@ -336,7 +336,9 @@ static VALUE aref(VALUE self, VALUE index)
 
 #ifdef __linux__
 void Init_raindrops_linux_inet_diag(void);
-void Init_raindrops_linux_tcp_info(void);
+#endif
+#ifdef HAVE_TYPE_STRUCT_TCP_INFO
+void Init_raindrops_tcp_info(void);
 #endif
 
 #ifndef _SC_NPROCESSORS_CONF
@@ -441,6 +443,8 @@ void Init_raindrops_ext(void)
 
 #ifdef __linux__
         Init_raindrops_linux_inet_diag();
-        Init_raindrops_linux_tcp_info();
+#endif
+#ifdef HAVE_TYPE_STRUCT_TCP_INFO
+        Init_raindrops_tcp_info();
 #endif
 }