curlassert macro replaced with DEBUGASSERT macro defined in setup_once.h

This commit is contained in:
Yang Tse
2007-02-21 19:03:20 +00:00
parent 908070821e
commit 5f5a8ca905
2 changed files with 14 additions and 3 deletions
+1 -1
View File
@@ -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];
}
+13 -2
View File
@@ -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