diff options
Diffstat (limited to 'ext/posix_mq/extconf.rb')
-rw-r--r-- | ext/posix_mq/extconf.rb | 11 |
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") |