curlassert macro replaced with DEBUGASSERT macro defined in setup_once.h

pull/1/head
Yang Tse 18 years ago
parent 908070821e
commit 5f5a8ca905
  1. 2
      ares_strerror.c
  2. 15
      setup_once.h

@ -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];
}

@ -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

Loading…
Cancel
Save