]> sourceware.org Git - newlib-cygwin.git/commitdiff
Improve check for int32_t being long or int
authorCorinna Vinschen <corinna@vinschen.de>
Wed, 29 Apr 2015 11:06:45 +0000 (13:06 +0200)
committerCorinna Vinschen <corinna@vinschen.de>
Wed, 29 Apr 2015 11:07:17 +0000 (13:07 +0200)
        * libc/include/sys/config.h: Move evaluation of _UINTPTR_EQ_ULONG and
        _UINTPTR_EQ_ULONGLONG from here...
        * libc/include/sys/_intsup.h: ...to here.  Rename to _INTPTR_EQ_LONG
        and _INTPTR_EQ_LONGLONG to refer to signed base type.  Add test for
        base type of int32_t and set _INT32_EQ_LONG accordingly.
        * libc/include/stdint.h: Change checks for __have_long32 to checks
        for _INT32_EQ_LONG.
        * libc/include/inttypes.h: Ditto.  Accommodate aforementioned name
        change.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
newlib/ChangeLog
newlib/libc/include/inttypes.h
newlib/libc/include/stdint.h
newlib/libc/include/sys/_intsup.h
newlib/libc/include/sys/config.h

index edf4a7fced33943d79cc1847fb325e5ebc5b2e37..2e8706367500eb13f1efb52ce8c83cb09e37fb85 100644 (file)
@@ -1,3 +1,15 @@
+2015-04-29  Corinna Vinschen  <vinschen@redhat.com>
+
+       * libc/include/sys/config.h: Move evaluation of _UINTPTR_EQ_ULONG and
+       _UINTPTR_EQ_ULONGLONG from here...
+       * libc/include/sys/_intsup.h: ...to here.  Rename to _INTPTR_EQ_LONG
+       and _INTPTR_EQ_LONGLONG to refer to signed base type.  Add test for
+       base type of int32_t and set _INT32_EQ_LONG accordingly.
+       * libc/include/stdint.h: Change checks for __have_long32 to checks
+       for _INT32_EQ_LONG.
+       * libc/include/inttypes.h: Ditto.  Accommodate aforementioned name
+       change.
+
 2015-04-22  Corinna Vinschen  <vinschen@redhat.com>
 
        * libc/include/libgen.h (basename): Drop defining _BASENAME_DEFINED.
index 52b2d845c42ef92c0bf8c26118e81c14dc2d8fde..7158cc6674b20c78b35a3875bf04e0bfa6d46649 100644 (file)
 #define SCNxFAST16     __SCN16(x)
 
 /* 32-bit types */
-#if __have_long32
+#if defined (_INT32_EQ_LONG)
 #define __PRI32(x) __STRINGIFY(l##x)
 #define __SCN32(x) __STRINGIFY(l##x)
 #else
 #define SCNxMAX                __SCNMAX(x)
 
 /* ptr types */
-#if defined(_UINTPTR_EQ_ULONGLONG)
+#if defined (_INTPTR_EQ_LONGLONG)
 # define __PRIPTR(x) __STRINGIFY(ll##x)
 # define __SCNPTR(x) __STRINGIFY(ll##x)
-#elif defined(_UINTPTR_EQ_ULONG)
+#elif defined (_INTPTR_EQ_LONG)
 # define __PRIPTR(x) __STRINGIFY(l##x)
 # define __SCNPTR(x) __STRINGIFY(l##x)
 #else
index aa9d68e9ecf541431df6ddc6af2e983f5a54ada8..bd65cd0e0e800289cb4b4a9ace60538672154614 100644 (file)
@@ -216,7 +216,7 @@ typedef __uint_least64_t uint_least64_t;
 #define INT32_MAX (__INT32_MAX__)
 #define UINT32_MAX (__UINT32_MAX__)
 #elif defined(__int32_t_defined)
-#if __have_long32
+#if defined (_INT32_EQ_LONG)
 #define INT32_MIN       (-2147483647L-1)
 #define INT32_MAX       (2147483647L)
 #define UINT32_MAX       (4294967295UL)
@@ -232,7 +232,7 @@ typedef __uint_least64_t uint_least64_t;
 #define INT_LEAST32_MAX (__INT_LEAST32_MAX__)
 #define UINT_LEAST32_MAX (__UINT_LEAST32_MAX__)
 #elif defined(__int_least32_t_defined)
-#if __have_long32
+#if defined (_INT32_EQ_LONG)
 #define INT_LEAST32_MIN  (-2147483647L-1)
 #define INT_LEAST32_MAX  (2147483647L)
 #define UINT_LEAST32_MAX (4294967295UL)
@@ -439,7 +439,7 @@ typedef __uint_least64_t uint_least64_t;
 #define INT32_C(x) __INT32_C(x)
 #define UINT32_C(x) __UINT32_C(x)
 #else
-#if __have_long32
+#if defined (_INT32_EQ_LONG)
 #define INT32_C(x)     x##L
 #define UINT32_C(x)    x##UL
 #else
index 7c3bc01cbbb362b91cc4d86b39a9a8d76a70c4be..6c53641a562b52a2834f4037acdb71c5e2dd15b4 100644 (file)
 #define __have_long32 1
 #endif
 
+/* Determine how intptr_t and int32_t are defined by gcc for this target. This
+   is used to determine the correct printf() constant in inttypes.h and other
+   constants in stdint.h. */
+#pragma push_macro("signed")
+#pragma push_macro("int")
+#pragma push_macro("long")
+#undef signed
+#undef int
+#undef long
+#define signed +0
+#define int +0
+#define long +1
+#if __INTPTR_TYPE__ == 2
+#define _INTPTR_EQ_LONGLONG
+#elif __INTPTR_TYPE__ == 1
+#define _INTPTR_EQ_LONG
+#elif __INTPTR_TYPE__ == 0
+/* Nothing to define because intptr_t is safe to print as an int. */
+#else
+#error "Unable to determine type definition of intptr_t"
+#endif
+#if __INT32_TYPE__ == 1
+#define _INT32_EQ_LONG
+#elif __INT32_TYPE__ == 0
+/* Nothing to define because int32_t is safe to print as an int. */
+#else
+#error "Unable to determine type definition of int32_t"
+#endif
+#undef long
+#undef int
+#undef signed
+#pragma pop_macro("signed")
+#pragma pop_macro("int")
+#pragma pop_macro("long") 
+
 #endif /* _SYS__INTSUP_H */
index 04f1e3abf2e3ed259a10a3033188b54dd21e0db8..5297befe58f4e4f3233a98850868368cc4d3aba5 100644 (file)
 #define _MB_EXTENDED_CHARSETS_WINDOWS 1
 #endif
 
-/* Determine how uintptr_t is defined by gcc for this target. This
-   is used to determine the correct printf() constant in inttypes.h */
-#pragma push_macro("signed")
-#pragma push_macro("int")
-#pragma push_macro("long")
-#undef signed
-#undef int
-#undef long
-#define signed +0
-#define int +0
-#define long +1
-#if __INTPTR_TYPE__ == 2
-#define _UINTPTR_EQ_ULONGLONG
-#elif __INTPTR_TYPE__ == 1
-#define _UINTPTR_EQ_ULONG
-#elif __INTPTR_TYPE__ == 0
-/* Nothing to define because intptr_t is safe to print as an int. */
-#else
-#error "Unable to determine type definition of uintptr_t"
-#endif
-#undef long
-#undef int
-#undef signed
-#pragma pop_macro("signed")
-#pragma pop_macro("int")
-#pragma pop_macro("long") 
 #endif /* __SYS_CONFIG_H__ */
This page took 0.056796 seconds and 5 git commands to generate.