summaryrefslogtreecommitdiff
path: root/mysys/default.c
diff options
context:
space:
mode:
authorunknown <tsmith@ramayana.hindu.god>2007-11-16 14:56:37 -0700
committerunknown <tsmith@ramayana.hindu.god>2007-11-16 14:56:37 -0700
commit975731aa32e5e641a53140ada4b1a3d5d325d6f5 (patch)
tree07ae65d68b707e1e8e7120d3fd455c68fa65f73b /mysys/default.c
parent1140bed510c0857d4d757c637d8ec10621c2354c (diff)
downloadmariadb-git-975731aa32e5e641a53140ada4b1a3d5d325d6f5.tar.gz
Eliminate 'unused variable' warnings when compiling non-debug build
Diffstat (limited to 'mysys/default.c')
-rw-r--r--mysys/default.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/mysys/default.c b/mysys/default.c
index a24f6583004..e58903d6d64 100644
--- a/mysys/default.c
+++ b/mysys/default.c
@@ -928,13 +928,22 @@ void print_defaults(const char *conf_file, const char **groups)
#include <help_end.h>
+/*
+ This extra complexity is to avoid declaring 'rc' if it won't be
+ used.
+*/
+#define ADD_DIRECTORY_INTERNAL(DIR) \
+ array_append_string_unique((DIR), default_directories, \
+ array_elements(default_directories))
+#ifdef DBUG_OFF
+# define ADD_DIRECTORY(DIR) (void) ADD_DIRECTORY_INTERNAL(DIR)
+#else
#define ADD_DIRECTORY(DIR) \
do { \
- my_bool rc= \
- array_append_string_unique((DIR), default_directories, \
- array_elements(default_directories)); \
+ my_bool rc= ADD_DIRECTORY_INTERNAL(DIR); \
DBUG_ASSERT(rc == FALSE); /* Success */ \
} while (0)
+#endif
#define ADD_COMMON_DIRECTORIES() \