diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-03-08 11:36:00 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-03-08 11:50:52 +0900 |
| commit | cb3a6dd16863da17ae84295e64441110a38bb347 (patch) | |
| tree | ca7d9d0bc5aef2983d7af790393d53c3db28cef5 /mrbgems | |
| parent | 833f556c70b33d427e36d737289e744c496a4d90 (diff) | |
| download | mruby-cb3a6dd16863da17ae84295e64441110a38bb347.tar.gz mruby-cb3a6dd16863da17ae84295e64441110a38bb347.zip | |
ISO C99 doesn't support unnamed unions; fix #5354
Diffstat (limited to 'mrbgems')
| -rw-r--r-- | mrbgems/mruby-bin-mirb/tools/mirb/mirb.c | 2 | ||||
| -rw-r--r-- | mrbgems/mruby-time/src/time.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c b/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c index 8cc756174..a4780a415 100644 --- a/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c +++ b/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c @@ -63,7 +63,7 @@ #define MIRB_USING_HISTORY() #endif -#ifndef _WIN32 +#if !defined(_WIN32) && defined(_POSIX_C_SOURCE) #define MIRB_SIGSETJMP(env) sigsetjmp(env, 1) #define MIRB_SIGLONGJMP(env, val) siglongjmp(env, val) #define SIGJMP_BUF sigjmp_buf diff --git a/mrbgems/mruby-time/src/time.c b/mrbgems/mruby-time/src/time.c index dc8a8ef22..5446d43f2 100644 --- a/mrbgems/mruby-time/src/time.c +++ b/mrbgems/mruby-time/src/time.c @@ -125,7 +125,7 @@ gettimeofday(struct timeval *tv, void *tz) # include <sys/time.h> # endif #endif -#ifdef NO_GMTIME_R +#if !(defined(_POSIX_C_SOURCE) || defined(_BSD_SOURCE) || defined(_SVID_SOURCE)) #define gmtime_r(t,r) gmtime(t) #define localtime_r(t,r) localtime(t) #endif @@ -383,7 +383,7 @@ current_mrb_time(mrb_state *mrb) sec = ts.tv_sec; usec = ts.tv_nsec / 1000; } -#elif (defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0) && defined(_POSIX_MONOTONIC_CLOCK) +#elif (defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0) && defined(CLOCK_MONOTONIC) { struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); |
