Header typedef workaround for newer MacOS versions

Newish version of MacOS's time.h already `typedef`s `clockid_t` but doesn't seem to `#define` anything indicating such; as a workaround assume that `#ifdef CLOCK_MONOTONIC` on a Mac means that `clockid_t` has been `typedef`'d.
This commit is contained in:
Michael Norton 2019-03-31 15:15:59 -06:00 committed by GitHub
parent 91e9635563
commit 8a6261d7c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View File

@ -3,9 +3,17 @@
#include <mach/mach_time.h> // Apple-only, but this isn't inclued on other BSDs
#ifdef __OpenBSD__
#ifdef _CLOCKID_T_DEFINED_
#define CLOCKID_T
#endif
#endif
#ifdef __APPLE__
#ifdef CLOCK_MONOTONIC
#define CLOCKID_T
#endif
#endif
#ifndef CLOCKID_T
#define CLOCKID_T

View File

@ -1,9 +1,17 @@
#ifndef CLOCK_NANOSLEEP_H
#define CLOCK_NANOSLEEP_H
#ifdef __OpenBSD__
#ifdef _CLOCKID_T_DEFINED_
#define CLOCKID_T
#endif
#endif
#ifdef __APPLE__
#ifdef CLOCK_MONOTONIC
#define CLOCKID_T
#endif
#endif
#ifndef CLOCKID_T
#define CLOCKID_T