Commit a5294a60 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add our own assert in libvarnish.h

Include libvarnish.h from cache.h and mgt.h



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@740 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 320667b1
......@@ -5,13 +5,14 @@
#include <sys/time.h>
#include <sys/uio.h>
#include <assert.h>
#include <pthread.h>
#include <stdint.h>
#include "queue.h"
#include "vsb.h"
#include "libvarnish.h"
#include "vcl_returns.h"
#include "common.h"
#include "miniobj.h"
......
......@@ -17,7 +17,6 @@
#include <sys/uio.h>
#include <sys/socket.h>
#include "libvarnish.h"
#include "heritage.h"
#include "shmlog.h"
#include "cache.h"
......
......@@ -10,7 +10,6 @@
#include <sys/types.h>
#include <md5.h>
#include <libvarnish.h>
#include <cache.h>
/*--------------------------------------------------------------------*/
......
......@@ -5,6 +5,8 @@
#include "common.h"
#include "miniobj.h"
#include "libvarnish.h"
extern struct evbase *mgt_evb;
/* mgt_child.c */
......
......@@ -10,7 +10,6 @@
#include <fcntl.h>
#include <stdlib.h>
#include <signal.h>
#include <assert.h>
#include <errno.h>
#include <poll.h>
#include <sys/types.h>
......@@ -18,7 +17,6 @@
#include <err.h> /* XXX */
#include "libvarnish.h"
#include "heritage.h"
#include "mgt.h"
#include "cli.h"
......
......@@ -6,7 +6,6 @@
#include <sys/types.h>
#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
......
......@@ -3,7 +3,6 @@
*/
#include <stdio.h>
#include <assert.h>
#include <errno.h>
#include <poll.h>
#include <time.h>
......@@ -11,6 +10,7 @@
#include <string.h>
#include <stdlib.h>
#include "mgt.h"
#include "mgt_event.h"
#include "miniobj.h"
#include "binary_heap.h"
......
......@@ -6,7 +6,6 @@
#include <sys/types.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
......@@ -16,7 +15,6 @@
#include "vsb.h"
#include "queue.h"
#include "libvarnish.h"
#include "libvcl.h"
#include "cli.h"
#include "cli_priv.h"
......
......@@ -11,7 +11,6 @@
#include <stdarg.h>
#include <sys/mman.h>
#include "libvarnish.h"
#include "shmlog.h"
#include "cache.h"
......
......@@ -20,7 +20,6 @@
#include <unistd.h>
#include "compat.h"
#include "libvarnish.h"
#include "shmlog.h"
#include "cache.h"
......
......@@ -5,7 +5,6 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <assert.h>
#include <errno.h>
#include <netdb.h>
#include <stdio.h>
......@@ -13,7 +12,6 @@
#include "heritage.h"
#include "mgt.h"
#include "libvarnish.h"
/*--------------------------------------------------------------------*/
......
......@@ -4,7 +4,6 @@
* The management process and CLI handling
*/
#include <assert.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
......@@ -19,7 +18,6 @@
#include "vsb.h"
#include "libvarnish.h"
#include "cli.h"
#include "cli_priv.h"
#include "cli_common.h"
......
......@@ -9,7 +9,6 @@
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
#include <vis.h>
#include "vsb.h"
......
......@@ -17,7 +17,6 @@
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
#include <vis.h>
#include <time.h>
......
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
......
......@@ -10,7 +10,6 @@
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
#include <curses.h>
#include <vis.h>
......
......@@ -2,6 +2,7 @@
* $Id$
*/
#include <errno.h>
#include <time.h>
/* from libvarnish/argv.c */
......@@ -15,5 +16,18 @@ time_t TIM_parse(const char *p);
/* 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)
......@@ -6,6 +6,7 @@ lib_LTLIBRARIES = libvarnish.la
libvarnish_la_SOURCES = \
argv.c \
assert.c \
binary_heap.c \
cli.c \
cli_common.c \
......
......@@ -12,7 +12,6 @@
*/
#include <ctype.h>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
......
/*
* $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();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment