+#include <errno.h>
+
+#undef NSEC_PER_SEC
+#undef NSEC_PER_MSEC
+#undef NSEC_PER_USEC
+#undef USEC_PER_SEC
+
+#endif /* __APPLE__ */
+
+/* macOS/OS X 10.12 (Sierra) and up provide clock_gettime() */
+#if defined(__APPLE__) && !defined(LTTNG_HAVE_CLOCK_GETTIME)