mirror of
https://github.com/janet-lang/janet
synced 2024-11-25 09:47:17 +00:00
Refactor __MACH__ to JANET_APPLE
This commit is contained in:
parent
c815185574
commit
f270739f9f
@ -68,7 +68,7 @@ extern char **environ;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* For macos */
|
/* For macos */
|
||||||
#ifdef __MACH__
|
#ifdef JANET_APPLE
|
||||||
#include <mach/clock.h>
|
#include <mach/clock.h>
|
||||||
#include <mach/mach.h>
|
#include <mach/mach.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -790,7 +790,7 @@ int32_t janet_sorted_keys(const JanetKV *dict, int32_t cap, int32_t *index_buffe
|
|||||||
/* Clock shims for various platforms */
|
/* Clock shims for various platforms */
|
||||||
#ifdef JANET_GETTIME
|
#ifdef JANET_GETTIME
|
||||||
/* For macos */
|
/* For macos */
|
||||||
#ifdef __MACH__
|
#ifdef JANET_APPLE
|
||||||
#include <mach/clock.h>
|
#include <mach/clock.h>
|
||||||
#include <mach/mach.h>
|
#include <mach/mach.h>
|
||||||
#endif
|
#endif
|
||||||
@ -806,7 +806,7 @@ int janet_gettime(struct timespec *spec) {
|
|||||||
spec->tv_nsec = wintime % 10000000LL * 100;
|
spec->tv_nsec = wintime % 10000000LL * 100;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#elif defined(__MACH__)
|
#elif defined(JANET_APPLE)
|
||||||
int janet_gettime(struct timespec *spec) {
|
int janet_gettime(struct timespec *spec) {
|
||||||
clock_serv_t cclock;
|
clock_serv_t cclock;
|
||||||
mach_timespec_t mts;
|
mach_timespec_t mts;
|
||||||
|
@ -57,8 +57,8 @@ extern "C" {
|
|||||||
#define JANET_BSD 1
|
#define JANET_BSD 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Check for Mac */
|
/* Check for macOS or OS X */
|
||||||
#ifdef __APPLE__
|
#if defined(__APPLE__) && defined(__MACH__)
|
||||||
#define JANET_APPLE 1
|
#define JANET_APPLE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user