Commit e16dd1d8 authored by antirez's avatar antirez
Browse files

assert.h replaced with redisassert.h when appropriate.

Also a warning was suppressed by including unistd.h in redisassert.h
(needed for _exit()).
parent 85070a30
...@@ -39,13 +39,13 @@ ...@@ -39,13 +39,13 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <stdarg.h> #include <stdarg.h>
#include <assert.h>
#include <limits.h> #include <limits.h>
#include <sys/time.h> #include <sys/time.h>
#include <ctype.h> #include <ctype.h>
#include "dict.h" #include "dict.h"
#include "zmalloc.h" #include "zmalloc.h"
#include "redisassert.h"
/* Using dictEnableResize() / dictDisableResize() we make possible to /* Using dictEnableResize() / dictDisableResize() we make possible to
* enable/disable resizing of the hash table as needed. This is very important * enable/disable resizing of the hash table as needed. This is very important
......
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
#include <sys/types.h> #include <sys/types.h>
#include <assert.h>
#include <errno.h> #include <errno.h>
#include <stdlib.h> #include <stdlib.h>
......
...@@ -38,7 +38,9 @@ ...@@ -38,7 +38,9 @@
#ifndef __REDIS_ASSERT_H__ #ifndef __REDIS_ASSERT_H__
#define __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); void _redisAssert(char *estr, char *file, int line);
......
...@@ -105,12 +105,12 @@ ...@@ -105,12 +105,12 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <stdint.h> #include <stdint.h>
#include <assert.h>
#include <limits.h> #include <limits.h>
#include "zmalloc.h" #include "zmalloc.h"
#include "util.h" #include "util.h"
#include "ziplist.h" #include "ziplist.h"
#include "endianconv.h" #include "endianconv.h"
#include "redisassert.h"
#define ZIP_END 255 #define ZIP_END 255
#define ZIP_BIGLEN 254 #define ZIP_BIGLEN 254
......
...@@ -78,7 +78,6 @@ ...@@ -78,7 +78,6 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <assert.h>
#include "zmalloc.h" #include "zmalloc.h"
#include "endianconv.h" #include "endianconv.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment