Commit a25cd930 authored by Pieter Noordhuis's avatar Pieter Noordhuis
Browse files

Define state strings only in DEBUG mode

parent df734805
...@@ -48,12 +48,6 @@ enum state { ...@@ -48,12 +48,6 @@ enum state {
}; };
#undef _ENUM_GEN #undef _ENUM_GEN
#define _ENUM_GEN(s) #s,
static const char * strstate[] = {
REDIS_PARSER_STATES(_ENUM_GEN)
};
#undef _ENUM_GEN
#define STATE(st) \ #define STATE(st) \
case s_##st: \ case s_##st: \
l_##st: \ l_##st: \
...@@ -76,6 +70,12 @@ static const char * strstate[] = { ...@@ -76,6 +70,12 @@ static const char * strstate[] = {
} while(0) } while(0)
#ifdef DEBUG #ifdef DEBUG
#define _ENUM_GEN(s) #s,
static const char *state_str[] = {
REDIS_PARSER_STATES(_ENUM_GEN)
};
#undef _ENUM_GEN
#define LOG(fmt, ...) do { \ #define LOG(fmt, ...) do { \
fprintf(stderr, fmt "\n", __VA_ARGS__); \ fprintf(stderr, fmt "\n", __VA_ARGS__); \
fflush(stderr); \ fflush(stderr); \
......
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