about summary refs log tree commit homepage
path: root/ext/posix_mq/extconf.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/posix_mq/extconf.rb')
-rw-r--r--ext/posix_mq/extconf.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/ext/posix_mq/extconf.rb b/ext/posix_mq/extconf.rb
index eb799b2..d433d1d 100644
--- a/ext/posix_mq/extconf.rb
+++ b/ext/posix_mq/extconf.rb
@@ -14,4 +14,15 @@ have_library("pthread")
 have_func("__mq_oshandle")
 have_func("mq_timedsend")
 have_func("mq_timedreceive")
+
+r, w = IO.pipe
+r.close
+w.close
+begin
+  r.close
+  $CPPFLAGS += ' -DIDEMPOTENT_IO_CLOSE=1'
+rescue IOError
+  $CPPFLAGS += ' -DIDEMPOTENT_IO_CLOSE=0'
+end
+
 create_makefile("posix_mq_ext")