diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2021-02-05 11:00:45 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2021-02-05 11:01:21 +0000 |
commit | e3d71d9bdfa31fb658794759f07af43d53253e5f (patch) | |
tree | 5afb52ea54d915dacb318793326a3ed741a367b2 /compat.h | |
parent | 3dd2e850759ef9e18e62b69300eba999a90d747e (diff) |
Add compat clock_gettime for older macOS. GitHub issue 2555.
Diffstat (limited to 'compat.h')
-rw-r--r-- | compat.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -265,6 +265,13 @@ void warnx(const char *, ...); #define HOST_NAME_MAX 255 #endif +#ifndef CLOCK_REALTIME +#define CLOCK_REALTIME 0 +#endif +#ifndef CLOCK_MONOTONIC +#define CLOCK_MONOTONIC CLOCK_REALTIME +#endif + #ifndef HAVE_FLOCK #define LOCK_SH 0 #define LOCK_EX 0 @@ -342,6 +349,11 @@ const char *getprogname(void); void setproctitle(const char *, ...); #endif +#ifndef HAVE_CLOCK_GETTIME +/* clock_gettime.c */ +int clock_gettime(int, struct timespec *); +#endif + #ifndef HAVE_B64_NTOP /* base64.c */ #undef b64_ntop |