about summary refs log tree commit homepage
path: root/ext/clogger_ext/extconf.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-01-14 09:07:57 +0000
committerEric Wong <normalperson@yhbt.net>2011-01-14 09:07:57 +0000
commitcc43cfbb418ab7b4b2786123d33ede23b3cb5ea3 (patch)
treef13ea8da377c8a95e2c860f7ca9307807dcab6de /ext/clogger_ext/extconf.rb
parent6cc7e96f972d9a648bef9d49ca245282250a5502 (diff)
downloadclogger-cc43cfbb418ab7b4b2786123d33ede23b3cb5ea3.tar.gz
This should also detect cases where CLOCK_MONOTONIC is
available at build but not at runtime.
Diffstat (limited to 'ext/clogger_ext/extconf.rb')
-rw-r--r--ext/clogger_ext/extconf.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/clogger_ext/extconf.rb b/ext/clogger_ext/extconf.rb
index d87d8c2..85f2d30 100644
--- a/ext/clogger_ext/extconf.rb
+++ b/ext/clogger_ext/extconf.rb
@@ -13,10 +13,11 @@ begin
     have_macro('O_NONBLOCK', %w(unistd.h fcntl.h))
   end
 
-  unless have_macro('CLOCK_MONOTONIC', 'time.h', '-D_POSIX_C_SOURCE=200112L')
-    $CPPFLAGS += '-D_POSIX_SOURCE_200112L'
+  $CPPFLAGS += '-D_POSIX_C_SOURCE=200112L'
+  unless have_macro('CLOCK_MONOTONIC', 'time.h')
     have_func('CLOCK_MONOTONIC', 'time.h')
   end
+  have_type('clockid_t', 'time.h')
   have_func('clock_gettime', 'time.h')
   have_func('localtime_r', 'time.h') or raise "localtime_r needed"
   have_func('gmtime_r', 'time.h') or raise "gmtime_r needed"