summaryrefslogtreecommitdiffstats
path: root/include/osmocom
diff options
context:
space:
mode:
Diffstat (limited to 'include/osmocom')
-rw-r--r--include/osmocom/core/timer.h1
-rw-r--r--include/osmocom/core/timer_compat.h4
2 files changed, 5 insertions, 0 deletions
diff --git a/include/osmocom/core/timer.h b/include/osmocom/core/timer.h
index caf4c678..19797662 100644
--- a/include/osmocom/core/timer.h
+++ b/include/osmocom/core/timer.h
@@ -45,6 +45,7 @@
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/linuxrbtree.h>
+#include <osmocom/core/timer_compat.h>
/* convert absolute time (in seconds) to elapsed days/hours/minutes */
#define OSMO_SEC2MIN(sec) ((sec % (60 * 60)) / 60)
diff --git a/include/osmocom/core/timer_compat.h b/include/osmocom/core/timer_compat.h
index 8fdd0a08..916f5684 100644
--- a/include/osmocom/core/timer_compat.h
+++ b/include/osmocom/core/timer_compat.h
@@ -27,6 +27,10 @@
#pragma once
+/* MacOS < 10.12 Sierra does not define clockid_t */
+#if defined(__APPLE__) && (!defined(__DARWIN_C_LEVEL) || __DARWIN_C_LEVEL < 199309L)
+typedef int clockid_t;
+#endif
/* Convenience macros for operations on timevals.
NOTE: `timercmp' does not work for >= or <=. */