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

Comparing CBOR-XS/ecb.h (file contents):
Revision 1.6 by root, Sun Jan 5 14:24:54 2014 UTC vs.
Revision 1.7 by root, Mon Jan 6 04:08:46 2014 UTC

87 #else 87 #else
88 #define ECB_GCC_VERSION(major,minor) (__GNUC__ > (major) || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor))) 88 #define ECB_GCC_VERSION(major,minor) (__GNUC__ > (major) || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)))
89 #endif 89 #endif
90#endif 90#endif
91 91
92#define ECB_C (__STDC__+0) /* this assumes that __STDC__ is either empty or a number */
93#define ECB_C99 (__STDC_VERSION__ >= 199901L)
94#define ECB_C11 (__STDC_VERSION__ >= 201112L)
95#define ECB_CPP (__cplusplus+0) 92#define ECB_CPP (__cplusplus+0)
96#define ECB_CPP11 (__cplusplus >= 201103L) 93#define ECB_CPP11 (__cplusplus >= 201103L)
94
95#if ECB_CPP
96 #define ECB_C 0
97 #define ECB_STDC_VERSION 0
98#else
99 #define ECB_C 1
100 #define ECB_STDC_VERSION __STDC_VERSION__
101#endif
102
103#define ECB_C99 (ECB_STDC_VERSION >= 199901L)
104#define ECB_C11 (ECB_STDC_VERSION >= 201112L)
97 105
98#if ECB_CPP 106#if ECB_CPP
99 #define ECB_EXTERN_C extern "C" 107 #define ECB_EXTERN_C extern "C"
100 #define ECB_EXTERN_C_BEG ECB_EXTERN_C { 108 #define ECB_EXTERN_C_BEG ECB_EXTERN_C {
101 #define ECB_EXTERN_C_END } 109 #define ECB_EXTERN_C_END }
278 #define ecb_is_constant(expr) __builtin_constant_p (expr) 286 #define ecb_is_constant(expr) __builtin_constant_p (expr)
279 #define ecb_expect(expr,value) __builtin_expect ((expr),(value)) 287 #define ecb_expect(expr,value) __builtin_expect ((expr),(value))
280 #define ecb_prefetch(addr,rw,locality) __builtin_prefetch (addr, rw, locality) 288 #define ecb_prefetch(addr,rw,locality) __builtin_prefetch (addr, rw, locality)
281#else 289#else
282 #define ecb_attribute(attrlist) 290 #define ecb_attribute(attrlist)
291
292 /* possible C11 impl for integral types
293 typedef struct ecb_is_constant_struct ecb_is_constant_struct;
294 #define ecb_is_constant(expr) _Generic ((1 ? (struct ecb_is_constant_struct *)0 : (void *)((expr) - (expr)), ecb_is_constant_struct *: 0, default: 1)) */
295
283 #define ecb_is_constant(expr) 0 296 #define ecb_is_constant(expr) 0
284 #define ecb_expect(expr,value) (expr) 297 #define ecb_expect(expr,value) (expr)
285 #define ecb_prefetch(addr,rw,locality) 298 #define ecb_prefetch(addr,rw,locality)
286#endif 299#endif
287 300

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines