]> sourceware.org Git - newlib-cygwin.git/commitdiff
* include/stdint.h Fix __STDC_CONSTANT_MACROS for 8 and 16 bit
authorDanny Smith <dannysmith@users.sourceforge.net>
Sat, 17 Jan 2004 07:41:54 +0000 (07:41 +0000)
committerDanny Smith <dannysmith@users.sourceforge.net>
Sat, 17 Jan 2004 07:41:54 +0000 (07:41 +0000)
types. (Thanks to John Maddock for report.)

winsup/mingw/ChangeLog
winsup/mingw/include/stdint.h

index a1497cc62a7953ff1788fc6c491635ac94ccc118..de8109a4eebdf499e12206ef746615ac6378bb08 100644 (file)
@@ -1,3 +1,8 @@
+2004-01-16  Danny Smith  <dannysmith@users.sourceforge.net>
+
+       * include/stdint.h  Fix __STDC_CONSTANT_MACROS for 8 and 16 bit
+       types. (Thanks to John Maddock for report.)
+
 2004-01-14  Greg Chicares  <chicares@users.sourceforge.net>
 
        * include/tchar.h (_puttchar): Define.
index 258002e3bc3f288fe783f1f6cef73b4fd78dabf6..2ea752fa377e692b7330db05d129a139832fe808 100644 (file)
@@ -163,25 +163,21 @@ typedef unsigned long long   uintmax_t;
        an integer constant with width less than that of type int.
        TC1 changed this to require just an integer constant
        *expression* with *promoted* type."
-
-       The trick used here is from Clive D W Feather.
 */
 
-#define INT8_C(val) (INT_LEAST8_MAX-INT_LEAST8_MAX+(val))
-#define INT16_C(val) (INT_LEAST16_MAX-INT_LEAST16_MAX+(val))
-#define INT32_C(val) (INT_LEAST32_MAX-INT_LEAST32_MAX+(val))
-/*  The 'trick' doesn't work in C89 for long long because, without
-    suffix, (val) will be evaluated as int, not intmax_t */ 
-#define INT64_C(val) val##LL
+#define INT8_C(val) ((int8_t) + (val))
+#define UINT8_C(val) ((uint8_t) + (val##U))
+#define INT16_C(val) ((int16_t) + (val))
+#define UINT16_C(val) ((uint16_t) + (val##U))
 
-#define UINT8_C(val) (UINT_LEAST8_MAX-UINT_LEAST8_MAX+(val))
-#define UINT16_C(val) (UINT_LEAST16_MAX-UINT_LEAST16_MAX+(val))
-#define UINT32_C(val) (UINT_LEAST32_MAX-UINT_LEAST32_MAX+(val))
+#define INT32_C(val) val##L
+#define UINT32_C(val) val##UL
+#define INT64_C(val) val##LL
 #define UINT64_C(val) val##ULL
 
 /* 7.18.4.2  Macros for greatest-width integer constants */
-#define INTMAX_C(val) val##LL
-#define UINTMAX_C(val) val##ULL
+#define INTMAX_C(val)  INT64_C(val)
+#define UINTMAX_C(val) UINT64_C(val)
 
 #endif  /* !defined ( __cplusplus) || defined __STDC_CONSTANT_MACROS */
 
This page took 0.037958 seconds and 5 git commands to generate.