1
0
mirror of https://github.com/janet-lang/janet synced 2024-06-18 11:19:56 +00:00

Refactor __MACH__ to JANET_APPLE

This commit is contained in:
Jason Pepas 2022-03-17 01:20:55 -05:00
parent c815185574
commit f270739f9f
3 changed files with 5 additions and 5 deletions

View File

@ -68,7 +68,7 @@ extern char **environ;
#endif
/* For macos */
#ifdef __MACH__
#ifdef JANET_APPLE
#include <mach/clock.h>
#include <mach/mach.h>
#endif

View File

@ -790,7 +790,7 @@ int32_t janet_sorted_keys(const JanetKV *dict, int32_t cap, int32_t *index_buffe
/* Clock shims for various platforms */
#ifdef JANET_GETTIME
/* For macos */
#ifdef __MACH__
#ifdef JANET_APPLE
#include <mach/clock.h>
#include <mach/mach.h>
#endif
@ -806,7 +806,7 @@ int janet_gettime(struct timespec *spec) {
spec->tv_nsec = wintime % 10000000LL * 100;
return 0;
}
#elif defined(__MACH__)
#elif defined(JANET_APPLE)
int janet_gettime(struct timespec *spec) {
clock_serv_t cclock;
mach_timespec_t mts;

View File

@ -57,8 +57,8 @@ extern "C" {
#define JANET_BSD 1
#endif
/* Check for Mac */
#ifdef __APPLE__
/* Check for macOS or OS X */
#if defined(__APPLE__) && defined(__MACH__)
#define JANET_APPLE 1
#endif