… | |
… | |
45 | #else |
45 | #else |
46 | #define ECB_GCC_VERSION(major,minor) (__GNUC__ > (major) || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor))) |
46 | #define ECB_GCC_VERSION(major,minor) (__GNUC__ > (major) || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor))) |
47 | #endif |
47 | #endif |
48 | #endif |
48 | #endif |
49 | |
49 | |
50 | #ifndef __cplusplus |
50 | #ifdef __cplusplus |
51 | #if __STDC_VERSION__ >= 199901L |
|
|
52 | #define ECB_INLINE static inline |
|
|
53 | typedef _Bool ecb_bool; |
|
|
54 | #else |
|
|
55 | #define ECB_INLINE static inline /* we assume the extension is ubiquituous, please tell us when we are wrong, or upgrade to the GCC */ |
|
|
56 | typedef int ecb_bool; |
|
|
57 | #endif |
|
|
58 | #else |
|
|
59 | #define ECB_INLINE static inline |
51 | #define ECB_INLINE static inline |
|
|
52 | #elif ECB_GCC_VERSION(2,5) |
|
|
53 | #define ECB_INLINE static __inline__ |
|
|
54 | #elif __STDC_VERSION__ >= 199901L |
|
|
55 | #define ECB_INLINE static inline |
|
|
56 | #else |
|
|
57 | #define ECB_INLINE static |
|
|
58 | #endif |
|
|
59 | |
|
|
60 | #if ECB_GCC_VERSION(3,3) |
|
|
61 | #define ecb_restrict __restrict__ |
|
|
62 | #elif __STDC_VERSION__ >= 199901L |
|
|
63 | #define ecb_restrict restrict |
|
|
64 | #else |
|
|
65 | #define ecb_restrict |
|
|
66 | #endif |
|
|
67 | |
60 | typedef bool ecb_bool; |
68 | typedef int ecb_bool; |
61 | #endif |
|
|
62 | |
69 | |
63 | #define ECB_CONCAT_(a, b) a ## b |
70 | #define ECB_CONCAT_(a, b) a ## b |
64 | #define ECB_CONCAT(a, b) ECB_CONCAT_(a, b) |
71 | #define ECB_CONCAT(a, b) ECB_CONCAT_(a, b) |
65 | #define ECB_STRINGIFY_(a) # a |
72 | #define ECB_STRINGIFY_(a) # a |
66 | #define ECB_STRINGIFY(a) ECB_STRINGIFY_(a) |
73 | #define ECB_STRINGIFY(a) ECB_STRINGIFY_(a) |