aboutsummaryrefslogtreecommitdiff
path: root/ares
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2007-02-21 19:03:20 +0000
committerYang Tse <yangsita@gmail.com>2007-02-21 19:03:20 +0000
commit3a634a273a7bff3d219883f572db786e2c1004b1 (patch)
treea0f1f70c6de10f38c29e3f5f468bed50db759ec1 /ares
parent06d1b029f63b9b03dfa3b9bfe34ba1baeb67df29 (diff)
curlassert macro replaced with DEBUGASSERT macro defined in setup_once.h
Diffstat (limited to 'ares')
-rw-r--r--ares/ares_strerror.c2
-rw-r--r--ares/setup_once.h15
2 files changed, 14 insertions, 3 deletions
diff --git a/ares/ares_strerror.c b/ares/ares_strerror.c
index 28d2e0bf1..3486ebfbb 100644
--- a/ares/ares_strerror.c
+++ b/ares/ares_strerror.c
@@ -46,6 +46,6 @@ const char *ares_strerror(int code)
"Illegal hints flags specified"
};
- assert(code >= 0 && code < (int)(sizeof(errtext) / sizeof(*errtext)));
+ DEBUGASSERT(code >= 0 && code < (int)(sizeof(errtext) / sizeof(*errtext)));
return errtext[code];
}
diff --git a/ares/setup_once.h b/ares/setup_once.h
index 32d8293ee..20ea3819d 100644
--- a/ares/setup_once.h
+++ b/ares/setup_once.h
@@ -200,9 +200,20 @@ typedef int sig_atomic_t;
*/
#ifdef CURLDEBUG
-#define DEBUGF(X) X
+#define DEBUGF(x) x
#else
-#define DEBUGF(X) do { } while (0)
+#define DEBUGF(x) do { } while (0)
+#endif
+
+
+/*
+ * Macro used to include assertion code only in debug builds.
+ */
+
+#if defined(CURLDEBUG) && defined(HAVE_ASSERT_H)
+#define DEBUGASSERT(x) assert(x)
+#else
+#define DEBUGASSERT(x) do { } while (0)
#endif