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

Comparing libecb/ecb.h (file contents):
Revision 1.11 by root, Thu May 26 18:00:42 2011 UTC vs.
Revision 1.12 by root, Thu May 26 18:17:45 2011 UTC

30#ifndef ECB_H 30#ifndef ECB_H
31#define ECB_H 31#define ECB_H
32 32
33#include <inttypes.h> 33#include <inttypes.h>
34 34
35/* many compilers define _GNUC_ to some versions but then only implement
36 * what their idiot authors think are the "more important" extensions,
37 * causing enourmous grief for some better fake benchmark numbers or so.
38 * we try to detect these and simply assume they are not gcc - if they have
39 * an issue with that they should have done it right in the first place.
40 */
41#if defined(__INTEL_COMPILER) || defined(__SUNPRO_C) || defined(__llvm__)
42# define ECB_GCC_VERSION(major,minor) 0
43#else
35#define ECB_GCC_VERSION(major,minor) (__GNUC__ > (major) || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor))) 44# define ECB_GCC_VERSION(major,minor) (__GNUC__ > (major) || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)))
45#endif
36 46
37#ifndef __cplusplus 47#ifndef __cplusplus
38# if __STDC_VERSION__ >= 199901L 48# if __STDC_VERSION__ >= 199901L
39# define ECB_INLINE inline 49# define ECB_INLINE inline
40typedef _Bool ecb_bool; 50typedef _Bool ecb_bool;
160{ 170{
161 return (x >> (32 - count)) | (x << count); 171 return (x >> (32 - count)) | (x << count);
162} 172}
163 173
164#if ECB_GCC_VERSION(4,3) 174#if ECB_GCC_VERSION(4,3)
165# define ecb_bswap32(x) __builtin_bswap32 (x) 175ECB_GCC_VERSION uint32_t ecb_bswap32 (uint32_t x) { return __builtin_bswap32 (x); }
166#else 176#else
167ECB_GCC_VERSION uint32_t 177ECB_GCC_VERSION uint32_t
168ecb_bswap32 (uint32_t x) 178ecb_bswap32 (uint32_t x)
169{ 179{
170 return (x >> 24) 180 return (x >> 24)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines