mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
More Solaris fixes
This commit is contained in:
parent
d7f43c081a
commit
5043dff351
3
redis.c
3
redis.c
@ -58,6 +58,9 @@
|
||||
#include <sys/resource.h>
|
||||
#include <limits.h>
|
||||
#include <math.h>
|
||||
#if defined(__sun) && defined(__GNUC__)
|
||||
#include "solarisfixes.h"
|
||||
#endif
|
||||
|
||||
#include "redis.h"
|
||||
#include "ae.h" /* Event driven programming library */
|
||||
|
16
solarisfixes.h
Normal file
16
solarisfixes.h
Normal file
@ -0,0 +1,16 @@
|
||||
/* Solaris specific fixes */
|
||||
|
||||
#undef isnan
|
||||
#define isnan(x) \
|
||||
__extension__({ __typeof (x) __x_a = (x); \
|
||||
__builtin_expect(__x_a != __x_a, 0); })
|
||||
|
||||
#undef isfinite
|
||||
#define isfinite(x) \
|
||||
__extension__ ({ __typeof (x) __x_f = (x); \
|
||||
__builtin_expect(!isnan(__x_f - __x_f), 1); })
|
||||
|
||||
#undef isinf
|
||||
#define isinf(x) \
|
||||
__extension__ ({ __typeof (x) __x_i = (x); \
|
||||
__builtin_expect(!isnan(__x_i) && !isfinite(__x_i), 0); })
|
Loading…
Reference in New Issue
Block a user