about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-01-03 04:17:56 +0000
committerEric Wong <normalperson@yhbt.net>2010-01-02 21:20:58 -0800
commit26015d39e9c848a536b4ea44802f858a4e6e74f7 (patch)
tree2c27270a828f334687415c082d941fc9f566a3f4
parente7ac70686b3c09953f6c41966dbd77f77368a9ec (diff)
downloadruby_posix_mq-26015d39e9c848a536b4ea44802f858a4e6e74f7.tar.gz
FreeBSD seems to need some files explicitly included.
-rw-r--r--ext/posix_mq/extconf.rb2
-rw-r--r--ext/posix_mq/posix_mq.c6
2 files changed, 8 insertions, 0 deletions
diff --git a/ext/posix_mq/extconf.rb b/ext/posix_mq/extconf.rb
index b45cff6..e890276 100644
--- a/ext/posix_mq/extconf.rb
+++ b/ext/posix_mq/extconf.rb
@@ -1,5 +1,7 @@
 require "mkmf"
 
+have_header("sys/select.h")
+have_header("signal.h")
 have_header("mqueue.h") or abort "mqueue.h header missing"
 have_func("rb_str_set_len")
 have_func("rb_struct_alloc_noinit")
diff --git a/ext/posix_mq/posix_mq.c b/ext/posix_mq/posix_mq.c
index 014927e..8ce1ab5 100644
--- a/ext/posix_mq/posix_mq.c
+++ b/ext/posix_mq/posix_mq.c
@@ -1,4 +1,10 @@
 #define _XOPEN_SOURCE 600
+#ifdef HAVE_SYS_SELECT_H
+#  include <sys/select.h>
+#endif
+#ifdef HAVE_SIGNAL_H
+#  include <signal.h>
+#endif
 #include <ruby.h>
 
 #include <time.h>