This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
[PATCH 07/18] Add BSD guard for clockid_t
- From: Sebastian Huber <sebastian dot huber at embedded-brains dot de>
- To: newlib at sourceware dot org
- Cc: devel at rtems dot org, Sebastian Huber <sebastian dot huber at embedded-brains dot de>
- Date: Thu, 14 Apr 2016 13:54:36 +0200
- Subject: [PATCH 07/18] Add BSD guard for clockid_t
- Authentication-results: sourceware.org; auth=none
- References: <1460634887-4420-1-git-send-email-sebastian dot huber at embedded-brains dot de>
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
---
newlib/libc/include/sys/_types.h | 4 +++-
newlib/libc/include/sys/types.h | 7 ++++---
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/newlib/libc/include/sys/_types.h b/newlib/libc/include/sys/_types.h
index ead18cb..ba112f5 100644
--- a/newlib/libc/include/sys/_types.h
+++ b/newlib/libc/include/sys/_types.h
@@ -151,7 +151,9 @@ typedef _CLOCK_T_ __clock_t;
#define _TIME_T_ long /* time() */
typedef _TIME_T_ __time_t;
-#define _CLOCKID_T_ unsigned long
+#define _CLOCKID_T_ unsigned long
+typedef _CLOCKID_T_ __clockid_t;
+
#define _TIMER_T_ unsigned long
typedef long __suseconds_t; /* microseconds (signed) */
diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h
index 2338cf5..f8db419 100644
--- a/newlib/libc/include/sys/types.h
+++ b/newlib/libc/include/sys/types.h
@@ -191,9 +191,10 @@ typedef __mode_t mode_t; /* permissions */
typedef unsigned short nlink_t;
-#ifndef __clockid_t_defined
-typedef _CLOCKID_T_ clockid_t;
-#define __clockid_t_defined
+#if !defined(__clockid_t_defined) && !defined(_CLOCKID_T_DECLARED)
+typedef __clockid_t clockid_t;
+#define __clockid_t_defined
+#define _CLOCKID_T_DECLARED
#endif
#ifndef __timer_t_defined
--
1.8.4.5