From 91fe02645fa3949d6339b7a2c04ee5103ed2b5af Mon Sep 17 00:00:00 2001 From: brarcher Date: Tue, 1 Oct 2013 22:21:06 +0000 Subject: [PATCH] Define monotonic and realtime clock, even if librt is available Cygwin has librt and implements clock_gettime(), but does not define CLOCK_MONOTONIC. Moving these definitions outside of the check for librt, as they may be needed even if the system has librt. git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@818 64e312b2-a51f-0410-8e61-82d0ca0eb02a --- lib/libcompat.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/libcompat.h b/lib/libcompat.h index 453253b..0848f67 100644 --- a/lib/libcompat.h +++ b/lib/libcompat.h @@ -116,14 +116,13 @@ const char *strsignal (int sig); int unsetenv (const char *name); #endif /* !HAVE_DECL_UNSETENV */ -#ifndef HAVE_LIBRT /* - * On systems where clock_gettime() is not available, the - * definition for CLOCK_MONOTONIC and CLOCK_REALTIME will - * also not be available. This variable should define which - * type of clock clock_gettime() should use. We define it - * here if it is not defined simply so the reimplementation - * can ignore it. + * On systems where clock_gettime() is not available, or + * on systems where some clocks may not be supported, the + * definition for CLOCK_MONOTONIC and CLOCK_REALTIME may not + * be available. These should define which type of clock + * clock_gettime() should use. We define it here if it is + * not defined simply so the reimplementation can ignore it. */ #ifndef CLOCK_MONOTONIC #define CLOCK_MONOTONIC 0 @@ -132,6 +131,7 @@ int unsetenv (const char *name); #define CLOCK_REALTIME 0 #endif +#ifndef HAVE_LIBRT #ifdef STRUCT_ITIMERSPEC_DEFINITION_MISSING /* * The following structure is defined in POSIX.1b for timer start values and intervals. -- 2.40.0