1 /* 2 * Copyright 2009, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _CONFIG_TYPES_H 6 #define _CONFIG_TYPES_H 7 8 9 #include <config/HaikuConfig.h> 10 11 #include <inttypes.h> 12 13 14 /* fixed-width types -- the __haiku_std_[u]int* types correspond to the POSIX 15 [u]int*_t types, the _haiku_[u]int* types to the BeOS [u]int* types. If 16 __HAIKU_BEOS_COMPATIBLE_TYPES is not defined both sets are identical. Once 17 we drop compatibility for good, we can consolidate the types. 18 */ 19 typedef int8_t __haiku_std_int8; 20 typedef uint8_t __haiku_std_uint8; 21 typedef int16_t __haiku_std_int16; 22 typedef uint16_t __haiku_std_uint16; 23 typedef int32_t __haiku_std_int32; 24 typedef uint32_t __haiku_std_uint32; 25 typedef int64_t __haiku_std_int64; 26 typedef uint64_t __haiku_std_uint64; 27 28 typedef __haiku_std_int8 __haiku_int8; 29 typedef __haiku_std_uint8 __haiku_uint8; 30 typedef __haiku_std_int16 __haiku_int16; 31 typedef __haiku_std_uint16 __haiku_uint16; 32 typedef __haiku_std_int32 __haiku_int32; 33 typedef __haiku_std_uint32 __haiku_uint32; 34 typedef __haiku_std_int64 __haiku_int64; 35 typedef __haiku_std_uint64 __haiku_uint64; 36 37 /* address types */ 38 #ifdef __HAIKU_ARCH_64_BIT 39 typedef __haiku_int64 __haiku_saddr_t; 40 typedef __haiku_uint64 __haiku_addr_t; 41 #else 42 typedef __haiku_int32 __haiku_saddr_t; 43 typedef __haiku_uint32 __haiku_addr_t; 44 #endif 45 46 /* address type limits */ 47 #ifdef __HAIKU_ARCH_64_BIT 48 # define __HAIKU_SADDR_MAX (9223372036854775807LL) 49 # define __HAIKU_ADDR_MAX (18446744073709551615ULL) 50 #else 51 # define __HAIKU_SADDR_MAX (2147483647) 52 # define __HAIKU_ADDR_MAX (4294967295U) 53 #endif 54 #define __HAIKU_SADDR_MIN (-__HAIKU_SADDR_MAX-1) 55 56 57 #endif /* _CONFIG_TYPES_H */ 58