Monday, 18 January 2021

[gccsdk] Patch to always define limit macros in stdint.h

Index: recipe/files/gcc/libunixlib/include/stdint.h
===================================================================
--- recipe/files/gcc/libunixlib/include/stdint.h (revision 7444)
+++ recipe/files/gcc/libunixlib/include/stdint.h (working copy)
@@ -84,10 +84,6 @@
typedef unsigned long int uintmax_t;
#endif

-/* The ISO C 9X standard specifies that in C++ implementations these
- macros should only be defined if explicitly requested. */
-#if !defined __cplusplus || defined __STDC_LIMIT_MACROS
-
/* Limits of integral types. */

/* Minimum of signed integral types. */
@@ -184,10 +180,6 @@
#define WINT_MIN (0)
#define WINT_MAX (4294967295U)

-#endif /* C++ && limit macros */
-
-#if !defined __cplusplus || defined __STDC_CONSTANT_MACROS
-
/* Signed. */
#define INT8_C(c) c
#define INT16_C(c) c
@@ -205,5 +197,3 @@
#define UINTMAX_C(c) c ## ULL

#endif
-
-#endif
Hi

Attached is a patch to remove the __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS checks from stdint.h. This reflects a similar change from glibc 2.18 (https://sourceware.org/bugzilla/show_bug.cgi?id=15366), and is needed for proper compliance with C11/C++11.

Regards
Cameron

No comments:

Post a Comment