summaryrefslogtreecommitdiff
path: root/native
diff options
context:
space:
mode:
authorPekka Enberg <penberg@kernel.org>2011-07-05 18:52:42 +0000
committerPekka Enberg <penberg@kernel.org>2011-07-05 18:52:42 +0000
commit820b03ea43b2e60285fba8d6a2029d232f097759 (patch)
tree3fa53c2659e2f433778be1a36d25d4e65b511b9b /native
parentfe9b7005fc53380e5166b1ddf1432ec3ff2659b7 (diff)
downloadclasspath-820b03ea43b2e60285fba8d6a2029d232f097759.tar.gz
Fix clock_gettime() support check for Darwin
Darwin doesn't support clock_gettime() but has _POSIX_MONOTONIC_CLOCK defined so use a more strict check with HAVE_CLOCK_GETTIME. This fixes the following compilation error: java_lang_VMSystem.c: In function ‘Java_java_lang_VMSystem_nanoTime’: java_lang_VMSystem.c:148: warning: implicit declaration of function ‘clock_gettime’ java_lang_VMSystem.c:148: error: ‘CLOCK_MONOTONIC’ undeclared (first use in this function) java_lang_VMSystem.c:148: error: (Each undeclared identifier is reported only once java_lang_VMSystem.c:148: error: for each function it appears in.) 2011-07-05 Pekka Enberg <penberg@kernel.org> * configure.ac: Check for clock_gettime(). native/jni/java-lang/java_lang_VMSystem.c: (Java_java_lang_VMSystem_nanoTime): Fix compile error on systems that don't have clock_gettime().
Diffstat (limited to 'native')
-rw-r--r--native/jni/java-lang/java_lang_VMSystem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/native/jni/java-lang/java_lang_VMSystem.c b/native/jni/java-lang/java_lang_VMSystem.c
index 047c2b394..f623857d3 100644
--- a/native/jni/java-lang/java_lang_VMSystem.c
+++ b/native/jni/java-lang/java_lang_VMSystem.c
@@ -141,7 +141,7 @@ Java_java_lang_VMSystem_nanoTime
(JNIEnv * env,
jclass thisClass __attribute__ ((__unused__)))
{
-#ifdef _POSIX_MONOTONIC_CLOCK
+#if defined(HAVE_CLOCK_GETTIME) && defined(_POSIX_MONOTONIC_CLOCK)
jlong result;
struct timespec tp;