33 #if defined(__cplusplus) 39 #if defined( _MSC_VER ) && ( _MSC_VER >= 1300 ) 41 # define ptrint_t intptr_t 42 #elif defined( __ECOS__ ) 43 # define intptr_t unsigned int 44 # define ptrint_t intptr_t 45 #elif defined( __GNUC__ ) && ( __GNUC__ >= 3 ) 47 # define ptrint_t intptr_t 54 # if UCHAR_MAX == 255u 55 typedef unsigned char uint_8t;
57 # error Please define uint_8t as an 8-bit unsigned integer type in brg_types.h 63 # if USHRT_MAX == 65535u 64 typedef unsigned short uint_16t;
66 # error Please define uint_16t as a 16-bit unsigned short type in brg_types.h 72 # if UINT_MAX == 4294967295u 73 # define li_32(h) 0x##h##u 74 typedef unsigned int uint_32t;
75 # elif ULONG_MAX == 4294967295u 76 # define li_32(h) 0x##h##ul 77 typedef unsigned long uint_32t;
78 # elif defined( _CRAY ) 79 # error This code needs 32-bit data types, which Cray machines do not provide 81 # error Please define uint_32t as a 32-bit unsigned integer type in brg_types.h 86 # if defined( __BORLANDC__ ) && !defined( __MSDOS__ ) 88 # define li_64(h) 0x##h##ui64 89 typedef unsigned __int64 uint_64t;
90 # elif defined( _MSC_VER ) && ( _MSC_VER < 1300 ) 92 # define li_64(h) 0x##h##ui64 93 typedef unsigned __int64 uint_64t;
94 # elif defined( __sun ) && defined( ULONG_MAX ) && ULONG_MAX == 0xfffffffful 96 # define li_64(h) 0x##h##ull 97 typedef unsigned long long uint_64t;
98 # elif defined( __MVS__ ) 100 # define li_64(h) 0x##h##ull 101 typedef unsigned int long long uint_64t;
102 # elif defined( UINT_MAX ) && UINT_MAX > 4294967295u 103 # if UINT_MAX == 18446744073709551615u 105 # define li_64(h) 0x##h##u 106 typedef unsigned int uint_64t;
108 # elif defined( ULONG_MAX ) && ULONG_MAX > 4294967295u 109 # if ULONG_MAX == 18446744073709551615ul 111 # define li_64(h) 0x##h##ul 112 typedef unsigned long uint_64t;
114 # elif defined( ULLONG_MAX ) && ULLONG_MAX > 4294967295u 115 # if ULLONG_MAX == 18446744073709551615ull 117 # define li_64(h) 0x##h##ull 118 typedef unsigned long long uint_64t;
120 # elif defined( ULONG_LONG_MAX ) && ULONG_LONG_MAX > 4294967295u 121 # if ULONG_LONG_MAX == 18446744073709551615ull 123 # define li_64(h) 0x##h##ull 124 typedef unsigned long long uint_64t;
129 #if !defined( BRG_UI64 ) 130 # if defined( NEED_UINT_64T ) 131 # error Please define uint_64t as an unsigned 64 bit type in brg_types.h 135 #ifndef RETURN_VALUES 136 # define RETURN_VALUES 137 # if defined( DLL_EXPORT ) 138 # if defined( _MSC_VER ) || defined ( __INTEL_COMPILER ) 139 # define VOID_RETURN __declspec( dllexport ) void __stdcall 140 # define INT_RETURN __declspec( dllexport ) int __stdcall 141 # elif defined( __GNUC__ ) 142 # define VOID_RETURN __declspec( __dllexport__ ) void 143 # define INT_RETURN __declspec( __dllexport__ ) int 145 # error Use of the DLL is only available on the Microsoft, Intel and GCC compilers 147 # elif defined( DLL_IMPORT ) 148 # if defined( _MSC_VER ) || defined ( __INTEL_COMPILER ) 149 # define VOID_RETURN __declspec( dllimport ) void __stdcall 150 # define INT_RETURN __declspec( dllimport ) int __stdcall 151 # elif defined( __GNUC__ ) 152 # define VOID_RETURN __declspec( __dllimport__ ) void 153 # define INT_RETURN __declspec( __dllimport__ ) int 155 # error Use of the DLL is only available on the Microsoft, Intel and GCC compilers 157 # elif defined( __WATCOMC__ ) 158 # define VOID_RETURN void __cdecl 159 # define INT_RETURN int __cdecl 161 # define VOID_RETURN void 162 # define INT_RETURN int 185 #define ALIGN_OFFSET(x,n) (((ptrint_t)(x)) & ((n) - 1)) 186 #define ALIGN_FLOOR(x,n) ((uint_8t*)(x) - ( ((ptrint_t)(x)) & ((n) - 1))) 187 #define ALIGN_CEIL(x,n) ((uint_8t*)(x) + (-((ptrint_t)(x)) & ((n) - 1))) 209 #define UI_TYPE(size) uint_##size##t 210 #define UNIT_TYPEDEF(x,size) typedef UI_TYPE(size) x 211 #define BUFR_TYPEDEF(x,size,bsize) typedef UI_TYPE(size) x[bsize / (size >> 3)] 212 #define UNIT_CAST(x,size) ((UI_TYPE(size) )(x)) 213 #define UPTR_CAST(x,size) ((UI_TYPE(size)*)(x)) 215 #if defined(__cplusplus)