1 /* DO NOT EDIT: automatically built from dist/clib_port.in. */ 2 /* 3 * Minimum/maximum values for various types. 4 */ 5 #ifndef UINT16_MAX /* Maximum 16-bit unsigned. */ 6 #define UINT16_MAX 65535 7 #endif 8 #ifndef UINT32_MAX /* Maximum 32-bit unsigned. */ 9 #define UINT32_MAX 4294967295U 10 #endif 11 12 #ifndef INT_MAX 13 #if SIZEOF_INT == 4 14 #define INT_MAX 2147483647 15 #endif 16 #if SIZEOF_INT == 8 17 #define INT_MAX 9223372036854775807 18 #endif 19 #endif 20 21 #ifndef INT_MIN /* minimum (signed) int value */ 22 #define INT_MIN (-INT_MAX-1) 23 #endif 24 25 #ifndef UINT_MAX /* maximum (signed) int value */ 26 #if SIZEOF_INT == 4 27 #define UINT_MAX 4294967295U 28 #endif 29 #if SIZEOF_INT == 8 30 #define UINT_MAX 18446744073709551615U 31 #endif 32 #endif 33 34 #ifndef LONG_MAX /* maximum (signed) long value */ 35 #if SIZEOF_LONG == 4 36 #define LONG_MAX 2147483647 37 #endif 38 #if SIZEOF_LONG == 8 39 #define LONG_MAX 9223372036854775807L 40 #endif 41 #endif 42 43 #ifndef LONG_MIN /* minimum (signed) long value */ 44 #define LONG_MIN (-LONG_MAX-1) 45 #endif 46 47 #ifndef ULONG_MAX /* maximum (unsigned) long value */ 48 #if SIZEOF_LONG == 4 49 #define ULONG_MAX 4294967295U 50 #endif 51 #if SIZEOF_LONG == 8 52 #define ULONG_MAX 18446744073709551615UL 53 #endif 54 #endif 55 56 #if defined(HAVE_64BIT_TYPES) 57 /* 58 * Override the system's 64-bit min/max constants. AIX's 32-bit compiler can 59 * handle 64-bit values, but the system's constants don't include the LL/ULL 60 * suffix, and so can't be compiled using the 32-bit compiler. 61 */ 62 #undef INT64_MAX 63 #undef INT64_MIN 64 #undef UINT64_MAX 65 66 #ifdef DB_WIN32 67 #define INT64_MAX _I64_MAX 68 #define INT64_MIN _I64_MIN 69 #define UINT64_MAX _UI64_MAX 70 #else 71 #define INT64_MAX 9223372036854775807LL 72 #define INT64_MIN (-INT64_MAX-1) 73 #define UINT64_MAX 18446744073709551615ULL 74 #endif /* DB_WIN32 */ 75 76 #define INT64_FMT "%I64d" 77 #define UINT64_FMT "%I64u" 78 #endif /* HAVE_64BIT_TYPES */ 79 80 /* 81 * Exit success/failure macros. 82 */ 83 #ifndef HAVE_EXIT_SUCCESS 84 #define EXIT_FAILURE 1 85 #define EXIT_SUCCESS 0 86 #endif 87 88 /* 89 * File modes. 90 */ 91 #ifdef DB_WIN32 92 #ifndef S_IREAD /* WinCE doesn't have S_IREAD. */ 93 #define S_IREAD 0 94 #endif 95 #ifndef S_IWRITE /* WinCE doesn't have S_IWRITE. */ 96 #define S_IWRITE 0 97 #endif 98 #ifndef S_IRUSR 99 #define S_IRUSR S_IREAD /* R for owner */ 100 #endif 101 #ifndef S_IWUSR 102 #define S_IWUSR S_IWRITE /* W for owner */ 103 #endif 104 #ifndef S_IXUSR 105 #define S_IXUSR 0 /* X for owner */ 106 #endif 107 #ifndef S_IRGRP 108 #define S_IRGRP 0 /* R for group */ 109 #endif 110 #ifndef S_IWGRP 111 #define S_IWGRP 0 /* W for group */ 112 #endif 113 #ifndef S_IXGRP 114 #define S_IXGRP 0 /* X for group */ 115 #endif 116 #ifndef S_IROTH 117 #define S_IROTH 0 /* R for other */ 118 #endif 119 #ifndef S_IWOTH 120 #define S_IWOTH 0 /* W for other */ 121 #endif 122 #ifndef S_IXOTH 123 #define S_IXOTH 0 /* X for other */ 124 #endif 125 #else /* !DB_WIN32 */ 126 #ifndef S_IRUSR 127 #define S_IRUSR 0000400 /* R for owner */ 128 #endif 129 #ifndef S_IWUSR 130 #define S_IWUSR 0000200 /* W for owner */ 131 #endif 132 #ifndef S_IXUSR 133 #define S_IXUSR 0000100 /* X for owner */ 134 #endif 135 #ifndef S_IRGRP 136 #define S_IRGRP 0000040 /* R for group */ 137 #endif 138 #ifndef S_IWGRP 139 #define S_IWGRP 0000020 /* W for group */ 140 #endif 141 #ifndef S_IXGRP 142 #define S_IXGRP 0000010 /* X for group */ 143 #endif 144 #ifndef S_IROTH 145 #define S_IROTH 0000004 /* R for other */ 146 #endif 147 #ifndef S_IWOTH 148 #define S_IWOTH 0000002 /* W for other */ 149 #endif 150 #ifndef S_IXOTH 151 #define S_IXOTH 0000001 /* X for other */ 152 #endif 153 #endif /* !DB_WIN32 */ 154 155 /* 156 * Don't step on the namespace. Other libraries may have their own 157 * implementations of these functions, we don't want to use their 158 * implementations or force them to use ours based on the load order. 159 */ 160 #ifndef HAVE_ATOI 161 #define atoi __db_Catoi 162 #endif 163 #ifndef HAVE_ATOL 164 #define atol __db_Catol 165 #endif 166 #ifndef HAVE_BSEARCH 167 #define bsearch __db_Cbsearch 168 #endif 169 #ifndef HAVE_FCLOSE 170 #define fclose __db_Cfclose 171 #endif 172 #ifndef HAVE_FGETC 173 #define fgetc __db_Cfgetc 174 #endif 175 #ifndef HAVE_FGETS 176 #define fgets __db_Cfgets 177 #endif 178 #ifndef HAVE_FOPEN 179 #define fopen __db_Cfopen 180 #endif 181 #ifndef HAVE_FWRITE 182 #define fwrite __db_Cfwrite 183 #endif 184 #ifndef HAVE_GETADDRINFO 185 #define freeaddrinfo(a) __db_Cfreeaddrinfo(a) 186 #define getaddrinfo(a, b, c, d) __db_Cgetaddrinfo(a, b, c, d) 187 #endif 188 #ifndef HAVE_GETCWD 189 #define getcwd __db_Cgetcwd 190 #endif 191 #ifndef HAVE_GETOPT 192 #define getopt __db_Cgetopt 193 #define optarg __db_Coptarg 194 #define opterr __db_Copterr 195 #define optind __db_Coptind 196 #define optopt __db_Coptopt 197 #define optreset __db_Coptreset 198 #endif 199 #ifndef HAVE_ISALPHA 200 #define isalpha __db_Cisalpha 201 #endif 202 #ifndef HAVE_ISDIGIT 203 #define isdigit __db_Cisdigit 204 #endif 205 #ifndef HAVE_ISPRINT 206 #define isprint __db_Cisprint 207 #endif 208 #ifndef HAVE_ISSPACE 209 #define isspace __db_Cisspace 210 #endif 211 #ifndef HAVE_LOCALTIME 212 #define localtime __db_Clocaltime 213 #endif 214 #ifndef HAVE_MEMCMP 215 #define memcmp __db_Cmemcmp 216 #endif 217 #ifndef HAVE_MEMCPY 218 #define memcpy __db_Cmemcpy 219 #endif 220 #ifndef HAVE_MEMMOVE 221 #define memmove __db_Cmemmove 222 #endif 223 #ifndef HAVE_PRINTF 224 #define printf __db_Cprintf 225 #define fprintf __db_Cfprintf 226 #endif 227 #ifndef HAVE_QSORT 228 #define qsort __db_Cqsort 229 #endif 230 #ifndef HAVE_RAISE 231 #define raise __db_Craise 232 #endif 233 #ifndef HAVE_RAND 234 #define rand __db_Crand 235 #define srand __db_Csrand 236 #endif 237 #ifndef HAVE_SNPRINTF 238 #define snprintf __db_Csnprintf 239 #endif 240 #ifndef HAVE_STRCASECMP 241 #define strcasecmp __db_Cstrcasecmp 242 #define strncasecmp __db_Cstrncasecmp 243 #endif 244 #ifndef HAVE_STRCAT 245 #define strcat __db_Cstrcat 246 #endif 247 #ifndef HAVE_STRCHR 248 #define strchr __db_Cstrchr 249 #endif 250 #ifndef HAVE_STRDUP 251 #define strdup __db_Cstrdup 252 #endif 253 #ifndef HAVE_STRERROR 254 #define strerror __db_Cstrerror 255 #endif 256 #ifndef HAVE_STRNCAT 257 #define strncat __db_Cstrncat 258 #endif 259 #ifndef HAVE_STRNCMP 260 #define strncmp __db_Cstrncmp 261 #endif 262 #ifndef HAVE_STRRCHR 263 #define strrchr __db_Cstrrchr 264 #endif 265 #ifndef HAVE_STRSEP 266 #define strsep __db_Cstrsep 267 #endif 268 #ifndef HAVE_STRTOL 269 #define strtol __db_Cstrtol 270 #endif 271 #ifndef HAVE_STRTOUL 272 #define strtoul __db_Cstrtoul 273 #endif 274 #ifndef HAVE_TIME 275 #define time __db_Ctime 276 #endif 277 #ifndef HAVE_VSNPRINTF 278 #define vsnprintf __db_Cvsnprintf 279 #endif 280