blind fix for macos crap

This commit is contained in:
Andrei Alexeyev 2021-04-29 20:43:57 +03:00
parent a824112930
commit c81bbd5e6a
No known key found for this signature in database
GPG key ID: 72D26128040B9690
2 changed files with 11 additions and 1 deletions

View file

@ -274,6 +274,7 @@ endif
config.set('TAISEI_BUILDCONF_USE_GNU_EXTENSIONS', get_option('use_gnu_ext'))
config.set('TAISEI_BUILDCONF_HAVE_BUILTIN_POPCOUNTLL', cc.has_function('__builtin_popcountll'))
config.set('TAISEI_BUILDCONF_HAVE_BUILTIN_POPCOUNT', cc.has_function('__builtin_popcount'))
config.set('TAISEI_BUILDCONF_HAVE_BUILTIN_AVAILABLE', cc.has_function('__builtin_available'))
if enable_zip and dep_zip.found()
if dep_zip.type_name() == 'internal'

View file

@ -14,7 +14,16 @@
void get_system_time(SystemTime *systime) {
#if defined(TAISEI_BUILDCONF_HAVE_TIMESPEC)
timespec_get(systime, TIME_UTC);
#if defined(TAISEI_BUILDCONF_HAVE_BUILTIN_AVAILABLE)
if(__builtin_available(macOS 10.15, *)) {
timespec_get(systime, TIME_UTC);
} else {
systime->tv_sec = time(NULL);
systime->tv_nsec = 0;
}
#else
timespec_get(systime, TIME_UTC);
#endif
#else
systime->tv_sec = time(NULL);
systime->tv_nsec = 0;