[PATCH v2 08/18] Add BSD guard for timer_t

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Apr 15 11:44:19 UTC 2016


Signed-off-by: Sebastian Huber <sebastian.huber at embedded-brains.de>
---
 newlib/libc/include/sys/_types.h | 3 ++-
 newlib/libc/include/sys/types.h  | 7 ++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/newlib/libc/include/sys/_types.h b/newlib/libc/include/sys/_types.h
index 6e6e2d3..7c2d963 100644
--- a/newlib/libc/include/sys/_types.h
+++ b/newlib/libc/include/sys/_types.h
@@ -154,7 +154,8 @@ typedef	_TIME_T_	__time_t;
 #define	_CLOCKID_T_ 	unsigned long
 typedef	_CLOCKID_T_	__clockid_t;
 
-#define _TIMER_T_   	unsigned long
+#define	_TIMER_T_	unsigned long
+typedef	_TIMER_T_	__timer_t;
 
 typedef	long		__suseconds_t;	/* microseconds (signed) */
 
diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h
index f8db419..d0627fd 100644
--- a/newlib/libc/include/sys/types.h
+++ b/newlib/libc/include/sys/types.h
@@ -197,9 +197,10 @@ typedef	__clockid_t	clockid_t;
 #define	_CLOCKID_T_DECLARED
 #endif
 
-#ifndef __timer_t_defined
-typedef _TIMER_T_ timer_t;
-#define __timer_t_defined
+#if !defined(__timer_t_defined) && !defined(_TIMER_T_DECLARED)
+typedef	__timer_t	timer_t;
+#define	__timer_t_defined
+#define	_TIMER_T_DECLARED
 #endif
 
 typedef unsigned long useconds_t;
-- 
1.8.4.5




More information about the devel mailing list