[PATCH v2 14/18] Add BSD guards for fixed-size integer types

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


From: Christian Mauderer <Christian.Mauderer at embedded-brains.de>

Signed-off-by: Christian Mauderer <christian.mauderer at embedded-brains.de>
---
 newlib/libc/include/sys/_stdint.h | 39 +++++++++++++++++++++++++++++++++++----
 1 file changed, 35 insertions(+), 4 deletions(-)

diff --git a/newlib/libc/include/sys/_stdint.h b/newlib/libc/include/sys/_stdint.h
index add1860..a7fe1e4 100644
--- a/newlib/libc/include/sys/_stdint.h
+++ b/newlib/libc/include/sys/_stdint.h
@@ -16,31 +16,62 @@ extern "C" {
 #endif
 
 #ifdef ___int8_t_defined
+#ifndef _INT8_T_DECLARED
 typedef __int8_t int8_t ;
+#define _INT8_T_DECLARED
+#endif
+#ifndef _UINT8_T_DECLARED
 typedef __uint8_t uint8_t ;
-#define __int8_t_defined 1
+#define _UINT8_T_DECLARED
 #endif
+#define __int8_t_defined 1
+#endif /* ___int8_t_defined */
 
 #ifdef ___int16_t_defined
+#ifndef _INT16_T_DECLARED
 typedef __int16_t int16_t ;
+#define _INT16_T_DECLARED
+#endif
+#ifndef _UINT16_T_DECLARED
 typedef __uint16_t uint16_t ;
-#define __int16_t_defined 1
+#define _UINT16_T_DECLARED
 #endif
+#define __int16_t_defined 1
+#endif /* ___int16_t_defined */
 
 #ifdef ___int32_t_defined
+#ifndef _INT32_T_DECLARED
 typedef __int32_t int32_t ;
+#define _INT32_T_DECLARED
+#endif
+#ifndef _UINT32_T_DECLARED
 typedef __uint32_t uint32_t ;
-#define __int32_t_defined 1
+#define _UINT32_T_DECLARED
 #endif
+#define __int32_t_defined 1
+#endif /* ___int32_t_defined */
 
 #ifdef ___int64_t_defined
+#ifndef _INT64_T_DECLARED
 typedef __int64_t int64_t ;
+#define _INT64_T_DECLARED
+#endif
+#ifndef _UINT64_T_DECLARED
 typedef __uint64_t uint64_t ;
-#define __int64_t_defined 1
+#define _UINT64_T_DECLARED
 #endif
+#define __int64_t_defined 1
+#endif /* ___int64_t_defined */
 
+#ifndef INTPTR_T_DECLARED
 typedef __intptr_t intptr_t;
+#define _INTPTR_T_DECLARED
+#endif
+
+#ifndef _UINTPTR_T_DECLARED
 typedef __uintptr_t uintptr_t;
+#define _UINTPTR_T_DECLARED
+#endif
 
 #ifdef __cplusplus
 }
-- 
1.8.4.5




More information about the devel mailing list