ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libecb/ecb.h
(Generate patch)

Comparing libecb/ecb.h (file contents):
Revision 1.22 by root, Thu May 26 19:39:40 2011 UTC vs.
Revision 1.23 by root, Thu May 26 19:40:09 2011 UTC

165/* this seems to work fine, but gcc always emits a warning for it :/ */ 165/* this seems to work fine, but gcc always emits a warning for it :/ */
166ECB_HEADER_INLINE void ecb_unreachable (void) ecb_noreturn; 166ECB_HEADER_INLINE void ecb_unreachable (void) ecb_noreturn;
167ECB_HEADER_INLINE void ecb_unreachable (void) { } 167ECB_HEADER_INLINE void ecb_unreachable (void) { }
168#endif 168#endif
169 169
170ECB_HEADER_INLINE unsigned char ecb_byteorder_helper () ecb_const; 170ECB_HEADER_INLINE unsigned char ecb_byteorder_helper (void) ecb_const;
171ECB_HEADER_INLINE unsigned char 171ECB_HEADER_INLINE unsigned char
172ecb_byteorder_helper () 172ecb_byteorder_helper (void)
173{ 173{
174 const uint32_t u = 0x11223344; 174 const uint32_t u = 0x11223344;
175 return *(unsigned char *)&u; 175 return *(unsigned char *)&u;
176} 176}
177 177
178ECB_HEADER_INLINE ecb_bool ecb_big_endian () ecb_const; 178ECB_HEADER_INLINE ecb_bool ecb_big_endian (void) ecb_const;
179ECB_HEADER_INLINE ecb_bool ecb_big_endian () { return ecb_byteorder_helper () == 0x11; }; 179ECB_HEADER_INLINE ecb_bool ecb_big_endian (void) { return ecb_byteorder_helper () == 0x11; };
180ECB_HEADER_INLINE ecb_bool ecb_little_endian () ecb_const; 180ECB_HEADER_INLINE ecb_bool ecb_little_endian (void) ecb_const;
181ECB_HEADER_INLINE ecb_bool ecb_little_endian () { return ecb_byteorder_helper () == 0x44; }; 181ECB_HEADER_INLINE ecb_bool ecb_little_endian (void) { return ecb_byteorder_helper () == 0x44; };
182 182
183#define ecb_mod(m, n) ((m) < 0 ? ((n) - (-(m) % (n))) : ((m) % (n))) 183#define ecb_mod(m, n) ((m) < 0 ? ((n) - (-(m) % (n))) : ((m) % (n)))
184 184
185#if ecb_cplusplus_does_not_suck 185#if ecb_cplusplus_does_not_suck
186// does not work for local types (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm) 186// does not work for local types (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines