]>
git.saurik.com Git - redis.git/blob - src/config.h
5 #include <AvailabilityMacros.h>
8 /* Define redis_fstat to fstat or fstat64() */
9 #if defined(__APPLE__) && !defined(MAC_OS_X_VERSION_10_6)
10 #define redis_fstat fstat64
11 #define redis_stat stat64
13 #define redis_fstat fstat
14 #define redis_stat stat
17 /* Test for proc filesystem */
22 /* Test for task_info() */
23 #if defined(__APPLE__)
24 #define HAVE_TASKINFO 1
27 /* Test for backtrace() */
28 #if defined(__APPLE__) || defined(__linux__) || defined(__sun)
29 #define HAVE_BACKTRACE 1
32 /* Test for polling API */
37 #if (defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_6)) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined (__NetBSD__)
42 #include <sys/feature_tests.h>
43 #ifdef _DTRACE_VERSION
48 /* Define aof_fsync to fdatasync() in Linux and fsync() for all the rest */
50 #define aof_fsync fdatasync
52 #define aof_fsync fsync
55 /* Define rdb_fsync_range to sync_file_range() on Linux, otherwise we use
56 * the plain fsync() call. */
58 #define rdb_fsync_range(fd,off,size) sync_file_range(fd,off,size,SYNC_FILE_RANGE_WAIT_BEFORE|SYNC_FILE_RANGE_WRITE)
60 #define rdb_fsync_range(fd,off,size) fsync(fd)
63 /* Byte ordering detection */
64 #include <sys/types.h> /* This will likely define BYTE_ORDER */
68 # include <machine/endian.h>
70 #if defined(linux) || defined(__linux__)
73 #define LITTLE_ENDIAN 1234 /* least-significant byte first (vax, pc) */
74 #define BIG_ENDIAN 4321 /* most-significant byte first (IBM, net) */
75 #define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long (pdp)*/
77 #if defined(__i386__) || defined(__x86_64__) || defined(__amd64__) || \
78 defined(vax) || defined(ns32000) || defined(sun386) || \
79 defined(MIPSEL) || defined(_MIPSEL) || defined(BIT_ZERO_ON_RIGHT) || \
80 defined(__alpha__) || defined(__alpha)
81 #define BYTE_ORDER LITTLE_ENDIAN
84 #if defined(sel) || defined(pyr) || defined(mc68000) || defined(sparc) || \
85 defined(is68k) || defined(tahoe) || defined(ibm032) || defined(ibm370) || \
86 defined(MIPSEB) || defined(_MIPSEB) || defined(_IBMR2) || defined(DGUX) ||\
87 defined(apollo) || defined(__convex__) || defined(_CRAY) || \
88 defined(__hppa) || defined(__hp9000) || \
89 defined(__hp9000s300) || defined(__hp9000s700) || \
90 defined (BIT_ZERO_ON_LEFT) || defined(m68k) || defined(__sparc)
91 #define BYTE_ORDER BIG_ENDIAN
95 #endif /* BYTE_ORDER */
97 #if defined(__BYTE_ORDER) && !defined(BYTE_ORDER)
98 #if (__BYTE_ORDER == __LITTLE_ENDIAN)
99 #define BYTE_ORDER LITTLE_ENDIAN
101 #define BYTE_ORDER BIG_ENDIAN
105 #if !defined(BYTE_ORDER) || \
106 (BYTE_ORDER != BIG_ENDIAN && BYTE_ORDER != LITTLE_ENDIAN)
107 /* you must determine what the correct bit order is for
108 * your compiler - the next line is an intentional error
109 * which will force your compiles to bomb until you fix
112 #error "Undefined or invalid BYTE_ORDER"
115 #if (__i386 || __amd64) && __GNUC__
116 #define GNUC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
117 #if GNUC_VERSION >= 40100