]> git.saurik.com Git - redis.git/blob - solarisfixes.h
Merge http://github.com/ngmoco/redis
[redis.git] / solarisfixes.h
1 /* Solaris specific fixes */
2
3 #if defined(__GNUC__)
4 #undef isnan
5 #define isnan(x) \
6 __extension__({ __typeof (x) __x_a = (x); \
7 __builtin_expect(__x_a != __x_a, 0); })
8
9 #undef isfinite
10 #define isfinite(x) \
11 __extension__ ({ __typeof (x) __x_f = (x); \
12 __builtin_expect(!isnan(__x_f - __x_f), 1); })
13
14 #undef isinf
15 #define isinf(x) \
16 __extension__ ({ __typeof (x) __x_i = (x); \
17 __builtin_expect(!isnan(__x_i) && !isfinite(__x_i), 0); })
18
19 #define u_int uint
20 #define u_int32_t uint32_t
21 #endif /* __GNUC__ */