Skip to content
/ janet Public
forked from janet-lang/janet

Commit

Permalink
Refactor __MACH__ to JANET_APPLE
Browse files Browse the repository at this point in the history
  • Loading branch information
cellularmitosis committed Mar 17, 2022
1 parent c815185 commit f270739
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/core/os.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ extern char **environ;
#endif

/* For macos */
#ifdef __MACH__
#ifdef JANET_APPLE
#include <mach/clock.h>
#include <mach/mach.h>
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/core/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/include/janet.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f270739

Please sign in to comment.