From: Amos Jeffries Date: Wed, 18 Feb 2009 00:18:43 +0000 (+1300) Subject: Remove duplicate assert.h, and bad includes of compat/* headers. X-Git-Tag: SQUID_3_2_0_1~1190^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ea9d149b304c1aee0be2db0e2c39e0f56723f504;p=thirdparty%2Fsquid.git Remove duplicate assert.h, and bad includes of compat/* headers. --- diff --git a/compat/GnuRegex.c b/compat/GnuRegex.c index 4018e1716d..b5ba9eb6b5 100644 --- a/compat/GnuRegex.c +++ b/compat/GnuRegex.c @@ -104,9 +104,8 @@ init_syntax_once(void) #define SYNTAX(c) re_syntax_table[c] - /* Get the interface, including the syntax bits. */ -#include "GnuRegex.h" +#include "compat/GnuRegex.h" /* Compile a fastmap for the compiled pattern in BUFFER; used to * accelerate searches. Return 0 if successful and -2 if was an diff --git a/compat/Makefile.am b/compat/Makefile.am index 10150cf5a6..3336941c88 100644 --- a/compat/Makefile.am +++ b/compat/Makefile.am @@ -25,11 +25,12 @@ $(OBJS): $(top_srcdir)/include/version.h $(top_srcdir)/include/autoconf.h noinst_LTLIBRARIES = libcompat.la libcompat_la_SOURCES = \ + assert.h \ compat.h \ - osdetect.h \ compat_shared.h \ fdsetsize.h \ gnuregex.h \ + osdetect.h \ stdvarargs.h \ valgrind.h \ \ @@ -46,6 +47,7 @@ libcompat_la_SOURCES = \ os/sunos.h \ os/windows.h \ \ + assert.cc \ compat.cc \ GnuRegex.c diff --git a/lib/assert.c b/compat/assert.cc similarity index 94% rename from lib/assert.c rename to compat/assert.cc index 229dbd46c6..b1e06e3315 100644 --- a/lib/assert.c +++ b/compat/assert.cc @@ -1,4 +1,3 @@ - /* * $Id$ * @@ -34,10 +33,16 @@ #include "config.h" +#if HAVE_STDIO_H #include +#endif +#if HAVE_STDLIB_H #include +#endif -#include "assert.h" +#if 0 +#include "compat/assert.h" +#endif void xassert(const char *expr, const char *file, int line) { diff --git a/include/Array.h b/include/Array.h index f687e4c206..052545d92e 100644 --- a/include/Array.h +++ b/include/Array.h @@ -41,7 +41,7 @@ #include "util.h" /* users of this template also need assert() */ -#include "assert.h" +#include "compat/assert.h" /* iterator support */ diff --git a/include/MemPool.h b/include/MemPool.h index 95b773b9c8..4abd92dac6 100644 --- a/include/MemPool.h +++ b/include/MemPool.h @@ -21,7 +21,6 @@ */ #include "config.h" -#include "assert.h" #include "util.h" #include "memMeter.h" diff --git a/include/assert.h b/include/assert.h deleted file mode 100644 index 651bf7cb65..0000000000 --- a/include/assert.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * $Id$ - * - * AUTHOR: Duane Wessels - * - * SQUID Web Proxy Cache http://www.squid-cache.org/ - * ---------------------------------------------------------- - * - * Squid is the result of efforts by numerous individuals from - * the Internet community; see the CONTRIBUTORS file for full - * details. Many organizations have provided support for Squid's - * development; see the SPONSORS file for full details. Squid is - * Copyrighted (C) 2001 by the Regents of the University of - * California; see the COPYRIGHT file for full details. Squid - * incorporates software developed and/or copyrighted by other - * sources; see the CREDITS file for full details. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. - * - */ -#ifndef SQUID_ASSERT_H -#define SQUID_ASSERT_H - -#include "config.h" - -#if defined(NODEBUG) -#define assert(EX) ((void)0) -#elif STDC_HEADERS -#define assert(EX) ((EX)?((void)0):xassert( # EX , __FILE__, __LINE__)) -#else -#define assert(EX) ((EX)?((void)0):xassert("EX", __FILE__, __LINE__)) -#endif -SQUIDCEXTERN void xassert(const char *, const char *, int); - -#endif diff --git a/lib/Makefile.am b/lib/Makefile.am index d11bc80367..46525be49c 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -89,7 +89,6 @@ libmiscutil_a_SOURCES = \ stub_memaccount.c \ util.c \ uudecode.c \ - assert.c \ xusleep.c \ $(XPROF_STATS_SOURCE) \ $(WIN32SRC) @@ -135,7 +134,7 @@ tests_testAll_SOURCES= \ tests/testMain.cc \ $(XPROF_STATS_SOURCE) \ $(WIN32SRC) \ - util.c assert.c + util.c tests_testAll_LDADD= @SQUID_CPPUNIT_LA@ @SQUID_CPPUNIT_LIBS@ diff --git a/lib/rfc1123.c b/lib/rfc1123.c index 074b9e83d8..5797646f9c 100644 --- a/lib/rfc1123.c +++ b/lib/rfc1123.c @@ -61,7 +61,6 @@ #if HAVE_SYS_TIME_H #include #endif -#include "assert.h" #include "util.h" diff --git a/src/AuthUser.cci b/src/AuthUser.cci index 497f995775..38ce96511f 100644 --- a/src/AuthUser.cci +++ b/src/AuthUser.cci @@ -33,8 +33,8 @@ * Copyright (c) 2003, Robert Collins */ -/* for assert() */ -#include "assert.h" +#include "config.h" + /* for xstrdup() */ #include "util.h" /* for safe_free() */ diff --git a/src/String.cci b/src/String.cci index bd97323d99..11dbd62cf3 100644 --- a/src/String.cci +++ b/src/String.cci @@ -32,7 +32,7 @@ * */ -#include "assert.h" +#include "config.h" #include String::String() : size_(0), len_(0), buf_ (NULL) diff --git a/src/acl.cc b/src/acl.cc index b848363dec..2dda02b1b2 100644 --- a/src/acl.cc +++ b/src/acl.cc @@ -33,19 +33,12 @@ */ #include "config.h" -#if 0 -#include "squid.h" -#include "HttpRequest.h" -#endif - #include "ACL.h" #include "ACLChecklist.h" #include "ConfigParser.h" #include "dlink.h" /* for special-case PURGE test */ #include "HttpRequestMethod.h" -/* for Vector<> Instances */ -#include "assert.h" const char *AclMatchedName = NULL; diff --git a/src/cf_gen.cc b/src/cf_gen.cc index d3a991321c..0180906a27 100644 --- a/src/cf_gen.cc +++ b/src/cf_gen.cc @@ -47,7 +47,6 @@ //#include "squid.h" #include "config.h" -#include "assert.h" //#include "SquidTime.h" #include "cf_gen_defines.h" #include "util.h" diff --git a/src/eCAP/ServiceRep.cc b/src/eCAP/ServiceRep.cc index 91f3b94647..5440e0008b 100644 --- a/src/eCAP/ServiceRep.cc +++ b/src/eCAP/ServiceRep.cc @@ -1,7 +1,6 @@ #include "squid.h" #include #include "TextException.h" -#include "assert.h" #include "eCAP/ServiceRep.h" #include "eCAP/XactionRep.h" diff --git a/src/eCAP/XactionRep.cc b/src/eCAP/XactionRep.cc index fa106cdf21..e1eb8216b9 100644 --- a/src/eCAP/XactionRep.cc +++ b/src/eCAP/XactionRep.cc @@ -3,7 +3,6 @@ #include #include #include "TextException.h" -#include "assert.h" #include "HttpRequest.h" #include "HttpReply.h" #include "eCAP/XactionRep.h" diff --git a/src/squid.h b/src/squid.h index defc840967..308d3598f0 100644 --- a/src/squid.h +++ b/src/squid.h @@ -40,8 +40,6 @@ using namespace Squid; /** \endcond */ #endif -#include "assert.h" - #if HAVE_UNISTD_H #include #endif diff --git a/test-suite/Makefile.am b/test-suite/Makefile.am index 47e2365d93..e9f5ddc854 100644 --- a/test-suite/Makefile.am +++ b/test-suite/Makefile.am @@ -17,7 +17,7 @@ INCLUDES = \ -I$(top_srcdir)/src LDADD = \ - -L$(top_builddir)/compat/libcompat.la \ + $(top_builddir)/compat/libcompat.la \ -L$(top_builddir)/lib -lmiscutil \ $(top_builddir)/src/globals.o \ $(top_builddir)/src/time.o diff --git a/tools/Makefile.am b/tools/Makefile.am index c9cbf46fee..45718d2d53 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -43,7 +43,11 @@ squidclient_SOURCES = squidclient.cc cachemgr__CGIEXT__SOURCES = cachemgr.cc cachemgr__CGIEXT__CXXFLAGS = -DDEFAULT_CACHEMGR_CONFIG=\"$(DEFAULT_CACHEMGR_CONFIG)\" $(AM_CXXFLAGS) -LDADD = ../src/ip/libip.la -L../lib -lmiscutil $(XTRA_LIBS) +LDADD = \ + ../compat/libcompat.la \ + ../src/ip/libip.la \ + -L../lib -lmiscutil \ + $(XTRA_LIBS) EXTRA_DIST = \ cachemgr.conf diff --git a/tools/cachemgr.cc b/tools/cachemgr.cc index 53a4333f51..211a29c899 100644 --- a/tools/cachemgr.cc +++ b/tools/cachemgr.cc @@ -129,7 +129,6 @@ extern "C" } #endif -#include "assert.h" #include "util.h" #include "ip/IpAddress.h" #include "getfullhostname.h"