From 73f5ff4e8646a5fddbeae5070a53f05870e51dd1 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 4 Oct 2011 11:50:35 -0400 Subject: [PATCH 1/1] make [U]INTn_C() macros have the right type... ...and still be valid in #if directives. --- include/stdint.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/stdint.h b/include/stdint.h index 54006678..634678a2 100644 --- a/include/stdint.h +++ b/include/stdint.h @@ -85,13 +85,13 @@ typedef unsigned long long uintmax_t; #if !defined __cplusplus || defined __STDC_CONSTANT_MACROS -#define INT8_C(c) c -#define INT16_C(c) c +#define INT8_C(c) ((int8_t) + (c)) +#define INT16_C(c) ((int16_t) + (c)) #define INT32_C(c) c #define INT64_C(c) c ## LL -#define UINT8_C(c) c ## U -#define UINT16_C(c) c ## U +#define UINT8_C(c) ((uint8_t) + (c)) +#define UINT16_C(c) ((uint16_t) + (c)) #define UINT32_C(c) c ## U #define UINT64_C(c) c ## ULL -- 2.20.1