timer: Fix clockid_t undefined on MacOS < 10.12

Related: OS#3722
Change-Id: If466a64bd44dcb8ae8a9b7f82bc9c9435ba3e640
This commit is contained in:
Pau Espin 2018-12-09 01:26:55 +01:00
parent 4f4905fac5
commit 2ca8cebac6
2 changed files with 5 additions and 0 deletions

View File

@ -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)

View File

@ -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 <=. */