diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-12-24 15:41:53 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-12-24 15:48:18 -0800 |
commit | 2816f3ceaa31452f6bb67a7a7297e6795221cb35 (patch) | |
tree | 3f3ed0229d2ce15e8287c513a2efa2a6fb47012f /ext/clogger_ext/extconf.rb | |
parent | 9b46379f75f384c86e42046ab03ce55231197c92 (diff) | |
download | clogger-2816f3ceaa31452f6bb67a7a7297e6795221cb35.tar.gz |
This lets us use CLOCK_MONOTONIC so we are not affected by system clock changes. We still convert to microseconds instead of nanoseconds for (pure)-Ruby 1.8 code compatibility. There is also little need for nanosecond timer resolution in log files (microsecond is not needed, even).
Diffstat (limited to 'ext/clogger_ext/extconf.rb')
-rw-r--r-- | ext/clogger_ext/extconf.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/clogger_ext/extconf.rb b/ext/clogger_ext/extconf.rb index b327ada..60c46a7 100644 --- a/ext/clogger_ext/extconf.rb +++ b/ext/clogger_ext/extconf.rb @@ -13,6 +13,10 @@ 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' + have_func('CLOCK_MONOTONIC', 'time.h') + end have_func('localtime_r', 'time.h') or raise "localtime_r needed" have_func('gmtime_r', 'time.h') or raise "gmtime_r needed" have_func('rb_str_set_len', 'ruby.h') |