aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-12-10 15:27:06 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-12-10 15:27:06 +0000
commit3b048880ad8db8fe7da65b4168e92f9da7212949 (patch)
tree5a0ffe84c1984270b5957d623419ae6ae61dd159 /lib
parent24ac5b8a6cc12c0fc1867c3236aaa052a4ee88c2 (diff)
we now have a 'curlassert' function to use
Diffstat (limited to 'lib')
-rw-r--r--lib/setup.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/setup.h b/lib/setup.h
index 03154331b..590b93934 100644
--- a/lib/setup.h
+++ b/lib/setup.h
@@ -76,8 +76,11 @@ typedef unsigned char bool;
#define _REENTRANT
#endif
-
#include <stdio.h>
+#ifdef HAVE_ASSERT_H
+#include <assert.h>
+#endif
+
#ifndef OS
#ifdef WIN32
#define OS "win32"
@@ -116,6 +119,14 @@ defined(HAVE_LIBSSL) && defined(HAVE_LIBCRYPTO)
#endif
#endif
+#if defined(CURLDEBUG) && defined(HAVE_ASSERT_H)
+#define NDEBUG
+#define curlassert(x) assert(x)
+#else
+/* does nothing without CURLDEBUG defined */
+#define curlassert(x)
+#endif
+
#ifdef MSG_NOSIGNAL
/* If we have the MSG_NOSIGNAL define, we make sure to use that in the forth
argument to send() and recv() */