* $Id$
*/
+#include <errno.h>
#include <time.h>
/* from libvarnish/argv.c */
/* from libvarnish/version.c */
void varnish_version(const char *);
+/* from libvarnish/assert.c */
+#ifdef WITHOUT_ASSERTS
+#define assert(e) ((void)0)
+#else /* WITH_ASSERTS */
+#define assert(e) \
+do { \
+ if (e) \
+ __assert(__func__, __FILE__, __LINE__, #e, errno); \
+} while (0)
+#endif
+
+void __assert(const char *, const char *, int, const char *, int);
+
/* Assert zero return value */
#define AZ(foo) do { assert((foo) == 0); } while (0)
--- /dev/null
+/*
+ * $Id$
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+
+
+void
+__assert(const char *func, const char *file, int line, const char *cond, int err)
+{
+
+ fprintf(stderr,
+ "Assert error in %s(), %s line %s:\n"
+ " Condition(%s) not true.\n"
+ " errno = %d (%s)\n", func, file, line, cond, err, strerror(err));
+ abort();
+}
+