1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 
   9 
  10 
  11 
  12 
  13 
  14 
  15 
  16 
  17 
  18 
  19 
  20 
  21 
  22 
  23 
  24 
  25 
  26 
  27 
  28 #ifndef OPAL_STDINT_H
  29 #define OPAL_STDINT_H 1
  30 
  31 #include "opal_config.h"
  32 
  33 
  34 
  35 
  36 #include <limits.h>
  37 #include <stdint.h>
  38 
  39 #ifdef HAVE_SYS_TYPES_H
  40 #include <sys/types.h>
  41 #endif
  42 
  43 
  44 
  45 #ifdef HAVE_INT128_T
  46 
  47 typedef int128_t opal_int128_t;
  48 typedef uint128_t opal_uint128_t;
  49 
  50 #define HAVE_OPAL_INT128_T 1
  51 
  52 #elif defined(HAVE___INT128)
  53 
  54 
  55 #pragma GCC diagnostic push
  56 
  57 
  58 
  59 #if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 6)
  60 #pragma GCC diagnostic ignored "-Wpedantic"
  61 #else
  62 #pragma GCC diagnostic ignored "-pedantic"
  63 #endif
  64 typedef __int128 opal_int128_t;
  65 typedef unsigned __int128 opal_uint128_t;
  66 #pragma GCC diagnostic pop
  67 
  68 #define HAVE_OPAL_INT128_T 1
  69 
  70 #else
  71 
  72 #define HAVE_OPAL_INT128_T 0
  73 
  74 #endif
  75 
  76 
  77 
  78 #if SIZEOF_VOID_P == SIZEOF_INT
  79 
  80 #ifndef HAVE_INTPTR_T
  81 typedef signed int intptr_t;
  82 #endif
  83 
  84 #ifndef HAVE_UINTPTR_T
  85 typedef unsigned int uintptr_t;
  86 #endif
  87 
  88 #elif SIZEOF_VOID_P == SIZEOF_LONG
  89 
  90 #ifndef HAVE_INTPTR_T
  91 typedef signed long intptr_t;
  92 #endif
  93 
  94 #ifndef HAVE_UINTPTR_T
  95 typedef unsigned long uintptr_t;
  96 #endif
  97 
  98 #elif SIZEOF_VOID_P == SIZEOF_LONG_LONG
  99 
 100 #ifndef HAVE_INTPTR_T
 101 typedef signed long long intptr_t;
 102 #endif
 103 #ifndef HAVE_UINTPTR_T
 104 typedef unsigned long long uintptr_t;
 105 #endif
 106 
 107 #else
 108 
 109 #error Failed to define pointer-sized integer types
 110 
 111 #endif
 112 
 113 
 114 # include <inttypes.h>
 115 
 116 #ifndef PRIsize_t
 117 # if defined(ACCEPT_C99)
 118 #   define PRIsize_t "zu"
 119 # elif SIZEOF_SIZE_T == SIZEOF_LONG
 120 #   define PRIsize_t "lu"
 121 # elif SIZEOF_SIZE_T == SIZEOF_LONG_LONG
 122 #   define PRIsize_t "llu"
 123 # else
 124 #   define PRIsize_t "u"
 125 # endif
 126 #endif
 127 
 128 #endif 
 129