Go to the documentation of this file.
40 #if defined(__cplusplus)
46 #if defined( _MSC_VER ) && ( _MSC_VER >= 1300 )
48 # define ptrint_t intptr_t
49 #elif defined( __ECOS__ )
50 # define intptr_t unsigned int
51 # define ptrint_t intptr_t
52 #elif defined( __GNUC__ ) && ( __GNUC__ >= 3 )
54 # define ptrint_t intptr_t
61 # if UCHAR_MAX == 255u
62 typedef unsigned char uint_8t;
64 # error Please define uint_8t as an 8-bit unsigned integer type in brg_types.h
70 # if USHRT_MAX == 65535u
71 typedef unsigned short uint_16t;
73 # error Please define uint_16t as a 16-bit unsigned short type in brg_types.h
79 # if UINT_MAX == 4294967295u
80 # define li_32(h) 0x##h##u
81 typedef unsigned int uint_32t;
82 # elif ULONG_MAX == 4294967295u
83 # define li_32(h) 0x##h##ul
84 typedef unsigned long uint_32t;
85 # elif defined( _CRAY )
89 typedef unsigned int uint_32t;
91 # error Please define uint_32t as a 32-bit unsigned integer type in brg_types.h
96 # if defined( __BORLANDC__ ) && !defined( __MSDOS__ )
98 # define li_64(h) 0x##h##ui64
99 typedef unsigned __int64 uint_64t;
100 # elif defined( _MSC_VER ) && ( _MSC_VER < 1300 )
102 # define li_64(h) 0x##h##ui64
103 typedef unsigned __int64 uint_64t;
104 # elif defined( __sun ) && defined( ULONG_MAX ) && ULONG_MAX == 0xfffffffful
106 # define li_64(h) 0x##h##ull
107 typedef unsigned long long uint_64t;
108 # elif defined( __MVS__ )
110 # define li_64(h) 0x##h##ull
111 typedef unsigned int long long uint_64t;
112 # elif defined( UINT_MAX ) && UINT_MAX > 4294967295u
113 # if UINT_MAX == 18446744073709551615u
115 # define li_64(h) 0x##h##u
116 typedef unsigned int uint_64t;
118 # elif defined( ULONG_MAX ) && ULONG_MAX > 4294967295u
119 # if ULONG_MAX == 18446744073709551615ul
121 # define li_64(h) 0x##h##ul
122 typedef unsigned long uint_64t;
124 # elif defined( ULLONG_MAX ) && ULLONG_MAX > 4294967295u
125 # if ULLONG_MAX == 18446744073709551615ull
127 # define li_64(h) 0x##h##ull
128 typedef unsigned long long uint_64t;
130 # elif defined( ULONG_LONG_MAX ) && ULONG_LONG_MAX > 4294967295u
131 # if ULONG_LONG_MAX == 18446744073709551615ull
133 # define li_64(h) 0x##h##ull
134 typedef unsigned long long uint_64t;
139 #if !defined( BRG_UI64 )
140 # if defined( NEED_UINT_64T )
141 # error Please define uint_64t as an unsigned 64 bit type in brg_types.h
145 #ifndef RETURN_VALUES
146 # define RETURN_VALUES
147 # if defined( DLL_EXPORT )
148 # if defined( _MSC_VER ) || defined ( __INTEL_COMPILER )
149 # define VOID_RETURN __declspec( dllexport ) void __stdcall
150 # define INT_RETURN __declspec( dllexport ) int __stdcall
151 # elif defined( __GNUC__ )
152 # define VOID_RETURN __declspec( __dllexport__ ) void
153 # define INT_RETURN __declspec( __dllexport__ ) int
155 # error Use of the DLL is only available on the Microsoft, Intel and GCC compilers
157 # elif defined( DLL_IMPORT )
158 # if defined( _MSC_VER ) || defined ( __INTEL_COMPILER )
159 # define VOID_RETURN __declspec( dllimport ) void __stdcall
160 # define INT_RETURN __declspec( dllimport ) int __stdcall
161 # elif defined( __GNUC__ )
162 # define VOID_RETURN __declspec( __dllimport__ ) void
163 # define INT_RETURN __declspec( __dllimport__ ) int
165 # error Use of the DLL is only available on the Microsoft, Intel and GCC compilers
167 # elif defined( __WATCOMC__ )
168 # define VOID_RETURN void __cdecl
169 # define INT_RETURN int __cdecl
171 # define VOID_RETURN void
172 # define INT_RETURN int
195 #define ALIGN_OFFSET(x,n) (((ptrint_t)(x)) & ((n) - 1))
196 #define ALIGN_FLOOR(x,n) ((uint_8t*)(x) - ( ((ptrint_t)(x)) & ((n) - 1)))
197 #define ALIGN_CEIL(x,n) ((uint_8t*)(x) + (-((ptrint_t)(x)) & ((n) - 1)))
219 #define UI_TYPE(size) uint_##size##t
220 #define UNIT_TYPEDEF(x,size) typedef UI_TYPE(size) x
221 #define BUFR_TYPEDEF(x,size,bsize) typedef UI_TYPE(size) x[bsize / (size >> 3)]
222 #define UNIT_CAST(x,size) ((UI_TYPE(size) )(x))
223 #define UPTR_CAST(x,size) ((UI_TYPE(size)*)(x))
225 #if defined(__cplusplus)