Permalink
Browse files

Check for gethrtime. Needed for solaris/smartos

The actual guard condition in the header already[1], this patch just
make it defined on the systems where gethrtime() defined, and disables
internal implementation

[1]: https://github.com/couchbase/couchbase-ruby-client/blob/master/ext/couchbase_ext/couchbase_ext.h#L32-L35

Change-Id: Ie4d1518e0ec41e30ecc849d93b26322c80d06de2
Reviewed-on: http://review.couchbase.org/24537
Reviewed-by: Trond Norbye <trond.norbye@gmail.com>
Tested-by: Sergey Avseyev <sergey.avseyev@gmail.com>
  • Loading branch information...
avsej committed Feb 12, 2013
1 parent cfb17a8 commit d78b8af958e74797d2d6888409196f98e63b5c5c
Showing with 6 additions and 0 deletions.
  1. +1 −0 ext/couchbase_ext/extconf.rb
  2. +5 −0 ext/couchbase_ext/gethrtime.c
@@ -135,6 +135,7 @@ def die(message)
have_func("clock_gettime")
have_func("gettimeofday")
have_func("QueryPerformanceCounter")
+have_func("gethrtime")
have_func("rb_hash_lookup2")
have_func("rb_thread_fd_select")
have_func("rb_thread_blocking_region")
@@ -16,6 +16,9 @@
*/
#include "couchbase_ext.h"
+
+#ifndef HAVE_GETHRTIME
+
#include <stdlib.h>
#include <time.h>
#include <assert.h>
@@ -122,3 +125,5 @@ hrtime_t gethrtime(void)
#error "I don't know how to build a highres clock..."
#endif
}
+
+#endif

0 comments on commit d78b8af

Please sign in to comment.