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

Comparing libecb/ecb.h (file contents):
Revision 1.19 by root, Thu May 26 18:43:48 2011 UTC vs.
Revision 1.20 by root, Thu May 26 19:21:42 2011 UTC

135} 135}
136#endif 136#endif
137 137
138#if ECB_GCC_VERSION(4,3) 138#if ECB_GCC_VERSION(4,3)
139# define ecb_bswap32(x) __builtin_bswap32 (x) 139# define ecb_bswap32(x) __builtin_bswap32 (x)
140# define ecb_bswap16(x) (__builtin_bswap32(x) >> 16)
140#else 141#else
141ECB_HEADER_INLINE uint32_t ecb_bswap32 (uint32_t x) ecb_const; 142ECB_HEADER_INLINE uint32_t ecb_bswap32 (uint32_t x) ecb_const;
142ECB_HEADER_INLINE uint32_t 143ECB_HEADER_INLINE uint32_t
143ecb_bswap32 (uint32_t x) 144ecb_bswap32 (uint32_t x)
144{ 145{
145 return (x >> 24) 146 return (x >> 24)
146 | ((x >> 8) & 0x0000ff00) 147 | ((x >> 8) & 0x0000ff00)
147 | ((x << 8) & 0x00ff0000) 148 | ((x << 8) & 0x00ff0000)
148 | (x << 24); 149 | (x << 24);
149} 150}
151
152ECB_HEADER_INLINE uint32_t ecb_bswap16 (uint32_t x) ecb_const;
153ECB_HEADER_INLINE uint32_t
154ecb_bswap16 (uint32_t x)
155{
156 return ((x >> 8) & 0xff)
157 | ((x << 8) & 0x00ff0000)
158 | (x << 24);
159}
150#endif 160#endif
151 161
152#if ECB_GCC_VERSION(4,5) 162#if ECB_GCC_VERSION(4,5)
153# define ecb_unreachable() __builtin_unreachable () 163# define ecb_unreachable() __builtin_unreachable ()
154#else 164#else

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines