1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-24 04:07:41 +00:00

Merge pull request #936 from cellularmitosis/janetapple

Refactor __MACH__ to JANET_APPLE
This commit is contained in:
Calvin Rose
2022-03-21 17:43:45 -05:00
committed by GitHub
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