diff options
author | antirez <antirez@gmail.com> | 2013-08-19 14:54:31 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2013-08-19 15:02:16 +0200 |
commit | 837817b2b711c2d75143853be164d477481a9730 (patch) | |
tree | 18145f13b706d835e963d9802afd63a066294ad1 | |
parent | bd353d9a3c8178e6a3bed1b0522e214edb048d83 (diff) | |
download | redis-837817b2b711c2d75143853be164d477481a9730.tar.gz |
assert.h replaced with redisassert.h when appropriate.
Also a warning was suppressed by including unistd.h in redisassert.h
(needed for _exit()).
-rw-r--r-- | src/dict.c | 2 | ||||
-rw-r--r-- | src/pqsort.c | 1 | ||||
-rw-r--r-- | src/redisassert.h | 4 | ||||
-rw-r--r-- | src/ziplist.c | 2 | ||||
-rw-r--r-- | src/zipmap.c | 1 |
5 files changed, 5 insertions, 5 deletions
diff --git a/src/dict.c b/src/dict.c index 3c1061f34..b041febcf 100644 --- a/src/dict.c +++ b/src/dict.c @@ -39,13 +39,13 @@ #include <stdlib.h> #include <string.h> #include <stdarg.h> -#include <assert.h> #include <limits.h> #include <sys/time.h> #include <ctype.h> #include "dict.h" #include "zmalloc.h" +#include "redisassert.h" /* Using dictEnableResize() / dictDisableResize() we make possible to * enable/disable resizing of the hash table as needed. This is very important diff --git a/src/pqsort.c b/src/pqsort.c index 57c217f94..7325a88a4 100644 --- a/src/pqsort.c +++ b/src/pqsort.c @@ -39,7 +39,6 @@ #include <sys/types.h> -#include <assert.h> #include <errno.h> #include <stdlib.h> diff --git a/src/redisassert.h b/src/redisassert.h index e2cf47cb5..e5825c0f5 100644 --- a/src/redisassert.h +++ b/src/redisassert.h @@ -38,7 +38,9 @@ #ifndef __REDIS_ASSERT_H__ #define __REDIS_ASSERT_H__ -#define redisAssert(_e) ((_e)?(void)0 : (_redisAssert(#_e,__FILE__,__LINE__),_exit(1))) +#include <unistd.h> /* for _exit() */ + +#define assert(_e) ((_e)?(void)0 : (_redisAssert(#_e,__FILE__,__LINE__),_exit(1))) void _redisAssert(char *estr, char *file, int line); diff --git a/src/ziplist.c b/src/ziplist.c index fdfc2e9ce..d78f8f5da 100644 --- a/src/ziplist.c +++ b/src/ziplist.c @@ -105,12 +105,12 @@ #include <stdlib.h> #include <string.h> #include <stdint.h> -#include <assert.h> #include <limits.h> #include "zmalloc.h" #include "util.h" #include "ziplist.h" #include "endianconv.h" +#include "redisassert.h" #define ZIP_END 255 #define ZIP_BIGLEN 254 diff --git a/src/zipmap.c b/src/zipmap.c index d9b7c8b31..3cd56e5ff 100644 --- a/src/zipmap.c +++ b/src/zipmap.c @@ -78,7 +78,6 @@ #include <stdio.h> #include <string.h> -#include <assert.h> #include "zmalloc.h" #include "endianconv.h" |