1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-26 04:04:49 +00:00

Move clock shims to util (Helps #430).

The thread module should also use these clock shims rather
than clock_gettime, which is not available on older mac systems.
This commit is contained in:
Calvin Rose
2020-07-03 09:54:58 -05:00
parent 97c64f27ff
commit b89f0fac7b
5 changed files with 46 additions and 34 deletions

View File

@@ -97,6 +97,13 @@ void janet_core_def(JanetTable *env, const char *name, Janet x, const void *p);
void janet_core_cfuns(JanetTable *env, const char *regprefix, const JanetReg *cfuns);
#endif
/* Clock gettime */
#if !defined(JANET_REDUCED_OS) || !defined(JANET_SINGLE_THREADED)
#include <time.h>
#define JANET_GETTIME
int janet_gettime(struct timespec *spec);
#endif
/* Initialize builtin libraries */
void janet_lib_io(JanetTable *env);
void janet_lib_math(JanetTable *env);