diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2020-04-18 11:24:12 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2020-04-18 11:25:47 +0300 |
commit | 1a52ff582def676b41d5160391ad474b7faa65d0 (patch) | |
tree | d6b185af0be4cb8f9399ecca31cbee02635db59a | |
parent | 4011b4b5c533c5030a993e3680e01b7b7d3f7fc5 (diff) | |
download | bdwgc-1a52ff582def676b41d5160391ad474b7faa65d0.tar.gz |
Fix 'implicit decl of clock_gettime' compiler error if -std=c11 on Linux
(fix of commit 4011b4b5c)
* include/private/gc_priv.h [!NO_CLOCK && !BSD_TIME && !(MSWIN32
|| MSWINCE || WINXP_USE_PERF_COUNTER) && !NN_PLATFORM_CTR && (CYGWIN32
|| LINUX)] (GET_TIME): Do not define to clock_gettime() unless
_POSIX_TIMERS is defined (and also __USE_POSIX199309 in case of linux).
-rw-r--r-- | include/private/gc_priv.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h index cabd7598..5c39d6a5 100644 --- a/include/private/gc_priv.h +++ b/include/private/gc_priv.h @@ -496,7 +496,9 @@ EXTERN_C_END # define MS_TIME_DIFF(a,b) ((unsigned long)n3ds_convert_tick_to_ms((a)-(b))) # define NS_FRAC_TIME_DIFF(a, b) 0UL /* TODO: implement it */ -#elif defined(NINTENDO_SWITCH) || defined(CYGWIN32) || defined(LINUX) +#elif defined(NINTENDO_SWITCH) \ + || (((defined(LINUX) && defined(__USE_POSIX199309)) \ + || defined(CYGWIN32)) && defined(_POSIX_TIMERS)) # include <time.h> # define CLOCK_TYPE struct timespec # define CLOCK_TYPE_INITIALIZER { 0, 0 } |