config.h 976 字节
Newer Older
1 2 3
#ifndef __CONFIG_H
#define __CONFIG_H

4 5 6 7
#ifdef __APPLE__
#include <AvailabilityMacros.h>
#endif

8
/* test for malloc_size() */
9 10
#ifdef __APPLE__
#include <malloc/malloc.h>
11
#define HAVE_MALLOC_SIZE 1
12 13 14 15
#define redis_malloc_size(p) malloc_size(p)
#endif

/* define redis_fstat to fstat or fstat64() */
16
#if defined(__APPLE__) && !defined(MAC_OS_X_VERSION_10_6)
17 18 19 20 21 22 23
#define redis_fstat fstat64
#define redis_stat stat64
#else
#define redis_fstat fstat
#define redis_stat stat
#endif

24 25 26 27 28
/* test for backtrace() */
#if defined(__APPLE__) || defined(__linux__)
#define HAVE_BACKTRACE 1
#endif

29 30 31 32 33
/* test for polling API */
#ifdef __linux__
#define HAVE_EPOLL 1
#endif

34
#if (defined(__APPLE__) && defined(MAC_OS_X_VERSION_10_6)) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined (__NetBSD__)
H
Harish Mallipeddi 已提交
35 36 37
#define HAVE_KQUEUE 1
#endif

38 39 40 41 42 43 44
/* define aof_fsync to fdatasync() in Linux and fsync() for all the rest */
#ifdef __linux__
#define aof_fsync fdatasync
#else
#define aof_fsync fsync
#endif

45
#endif