… | |
… | |
182 | ECB_HEADER_INLINE ecb_bool ecb_big_endian (void) ecb_const; |
182 | ECB_HEADER_INLINE ecb_bool ecb_big_endian (void) ecb_const; |
183 | ECB_HEADER_INLINE ecb_bool ecb_big_endian (void) { return ecb_byteorder_helper () == 0x11; }; |
183 | ECB_HEADER_INLINE ecb_bool ecb_big_endian (void) { return ecb_byteorder_helper () == 0x11; }; |
184 | ECB_HEADER_INLINE ecb_bool ecb_little_endian (void) ecb_const; |
184 | ECB_HEADER_INLINE ecb_bool ecb_little_endian (void) ecb_const; |
185 | ECB_HEADER_INLINE ecb_bool ecb_little_endian (void) { return ecb_byteorder_helper () == 0x44; }; |
185 | ECB_HEADER_INLINE ecb_bool ecb_little_endian (void) { return ecb_byteorder_helper () == 0x44; }; |
186 | |
186 | |
|
|
187 | #if ECB_GCC_VERSION(3,0)&&0 |
|
|
188 | # define ecb_mod(m,n) ((m) % (n) + ((m) % (n) < 0 ? (n) : 0)) |
|
|
189 | #else |
187 | #define ecb_mod(m,n) ((m) < 0 ? ((n) - (-(m) % (n))) : ((m) % (n))) |
190 | # define ecb_mod(m,n) ((m) < 0 ? ((n) - 1 - ((-1 - (m)) % (n))) : ((m) % (n))) |
|
|
191 | #endif |
188 | |
192 | |
189 | #if ecb_cplusplus_does_not_suck |
193 | #if ecb_cplusplus_does_not_suck |
190 | // does not work for local types (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm) |
194 | // does not work for local types (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm) |
191 | template<typename T, int N> |
195 | template<typename T, int N> |
192 | static inline int ecb_array_length (const T (&arr)[N]) |
196 | static inline int ecb_array_length (const T (&arr)[N]) |