mirror of https://gerrit.osmocom.org/libosmocore
timer: Fix clockid_t undefined on MacOS < 10.12
Related: OS#3722 Change-Id: If466a64bd44dcb8ae8a9b7f82bc9c9435ba3e640
This commit is contained in:
parent
4f4905fac5
commit
2ca8cebac6
|
@ -45,6 +45,7 @@
|
||||||
|
|
||||||
#include <osmocom/core/linuxlist.h>
|
#include <osmocom/core/linuxlist.h>
|
||||||
#include <osmocom/core/linuxrbtree.h>
|
#include <osmocom/core/linuxrbtree.h>
|
||||||
|
#include <osmocom/core/timer_compat.h>
|
||||||
|
|
||||||
/* convert absolute time (in seconds) to elapsed days/hours/minutes */
|
/* convert absolute time (in seconds) to elapsed days/hours/minutes */
|
||||||
#define OSMO_SEC2MIN(sec) ((sec % (60 * 60)) / 60)
|
#define OSMO_SEC2MIN(sec) ((sec % (60 * 60)) / 60)
|
||||||
|
|
|
@ -27,6 +27,10 @@
|
||||||
|
|
||||||
#pragma once
|
#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.
|
/* Convenience macros for operations on timevals.
|
||||||
NOTE: `timercmp' does not work for >= or <=. */
|
NOTE: `timercmp' does not work for >= or <=. */
|
||||||
|
|
Loading…
Reference in New Issue