]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: time: switch clockid_t to empty_t when not available
authorWilly Tarreau <w@1wt.eu>
Tue, 21 May 2019 17:58:16 +0000 (19:58 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 21 May 2019 18:03:03 +0000 (20:03 +0200)
This is cleaner than using an int. We also get rid of the constants
that we don't need nor use.

include/common/compat.h

index 07b3666e33ebd29b9fb199f453c37c7971783405..e0f00dcf1eb096584a015e78255c99c4dde0eed7 100644 (file)
@@ -106,13 +106,8 @@ typedef struct { } empty_t;
 
 /* systems without such defines do not know clockid_t */
 #if !(_POSIX_TIMERS > 0) || (_POSIX_C_SOURCE < 199309L)
-#define clockid_t int
-#undef CLOCK_REALTIME
-#undef CLOCK_MONOTONIC
-#undef CLOCK_THREAD_CPUTIME_ID
-#define CLOCK_REALTIME           0
-#define CLOCK_MONOTONIC          1
-#define CLOCK_THREAD_CPUTIME_ID  2
+#undef clockid_t
+#define clockid_t empty_t
 #endif
 
 #if defined(TPROXY) && defined(NETFILTER)