From 122d1cddc94ee82bdbffed8b9d2d3780ed7a0b99 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Wed, 19 Feb 2014 21:51:24 -0600 Subject: [PATCH] Haiku: Fix posix INT64_C macros on x86_64 * Was causing LLVM to fail to build on x86_64 * Make XINT64 adjust based on architecture like config/types.h to ensure these macros match uint64 and int64 at all times. * Resolves #10566 --- headers/posix/stdint.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/headers/posix/stdint.h b/headers/posix/stdint.h index eb07104a5a..f94f945498 100644 --- a/headers/posix/stdint.h +++ b/headers/posix/stdint.h @@ -136,16 +136,22 @@ typedef uint64_t uintmax_t; #define INT8_C(value) value #define INT16_C(value) value #define INT32_C(value) value -#define INT64_C(value) value ## LL #define UINT8_C(value) value ## U #define UINT16_C(value) value ## U #define UINT32_C(value) value ## U -#define UINT64_C(value) value ## ULL -/* Macros for greatest-width integer constant expressions */ +#if defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ > 4 +#define INT64_C(value) value ## L +#define UINT64_C(value) value ## UL +#define INTMAX_C(value) value ## L +#define UINTMAX_C(value) value ## UL +#else +#define INT64_C(value) value ## LL +#define UINT64_C(value) value ## ULL #define INTMAX_C(value) value ## LL -#define UINTMAX_C(value) value ## ULL +#define UINTMAX_C(value) value ## ULL +#endif #endif /* !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) */