Ticket #10566: 0001-Haiku-Fix-posix-XINT64-macros.patch

File 0001-Haiku-Fix-posix-XINT64-macros.patch, 1.5 KB (added by kallisti5, 6 years ago)

untested rev 1

  • headers/posix/stdint.h

    From 19eeec5f60a7d06d0e13bf9393a70e8c3442df63 Mon Sep 17 00:00:00 2001
    From: Alexander von Gluck IV <kallisti5@unixzen.com>
    Date: Wed, 19 Feb 2014 21:51:24 -0600
    Subject: [PATCH] Haiku: Fix posix XINT64 macros
    
    * 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 eb07104..f94f945 100644
    a b typedef uint64_t uintmax_t;  
    136136#define INT8_C(value)   value
    137137#define INT16_C(value)  value
    138138#define INT32_C(value)  value
    139 #define INT64_C(value)  value ## LL
    140139
    141140#define UINT8_C(value)  value ## U
    142141#define UINT16_C(value) value ## U
    143142#define UINT32_C(value) value ## U
    144 #define UINT64_C(value) value ## ULL
    145143
    146 /* Macros for greatest-width integer constant expressions */
     144#if defined(__SIZEOF_LONG__) && __SIZEOF_LONG__ > 4
     145#define INT64_C(value)      value ## L
     146#define UINT64_C(value)     value ## UL
     147#define INTMAX_C(value)     value ## L
     148#define UINTMAX_C(value)    value ## UL
     149#else
     150#define INT64_C(value)      value ## LL
     151#define UINT64_C(value)     value ## ULL
    147152#define INTMAX_C(value)     value ## LL
    148 #define UINTMAX_C(value)    value ## ULL
     153#define UINTMAX_C(value)    value ## ULL
     154#endif
    149155
    150156#endif /* !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) */
    151157