Change in libosmocore[master]: timer: Fix clockid_t undefined on MacOS < 10.12

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Mon Dec 10 10:05:03 UTC 2018


Pau Espin Pedrol has submitted this change and it was merged. ( https://gerrit.osmocom.org/12210 )

Change subject: timer: Fix clockid_t undefined on MacOS < 10.12
......................................................................

timer: Fix clockid_t undefined on MacOS < 10.12

Related: OS#3722
Change-Id: If466a64bd44dcb8ae8a9b7f82bc9c9435ba3e640
---
M include/osmocom/core/timer.h
M include/osmocom/core/timer_compat.h
2 files changed, 5 insertions(+), 0 deletions(-)

Approvals:
  Pau Espin Pedrol: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/core/timer.h b/include/osmocom/core/timer.h
index caf4c67..1979766 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 8fdd0a0..916f568 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 <=.  */

-- 
To view, visit https://gerrit.osmocom.org/12210
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: If466a64bd44dcb8ae8a9b7f82bc9c9435ba3e640
Gerrit-Change-Number: 12210
Gerrit-PatchSet: 2
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181210/28f11c35/attachment.htm>


More information about the gerrit-log mailing list