]> err.no Git - varnish/commitdiff
Split compat.h into one header per function to avoid issues with e.g. the
authordes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 8 Aug 2006 07:17:10 +0000 (07:17 +0000)
committerdes <des@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 8 Aug 2006 07:17:10 +0000 (07:17 +0000)
vasprintf() prototype needing <stdarg.h> even when it isn't used.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@761 d4fa192b-c00b-0410-8231-f00ffab90ce4

15 files changed:
varnish-cache/bin/varnishd/mgt_cli.c
varnish-cache/bin/varnishd/mgt_vcc.c
varnish-cache/bin/varnishd/storage_file.c
varnish-cache/bin/varnishd/tcp.c
varnish-cache/include/Makefile.am
varnish-cache/include/compat.h [deleted file]
varnish-cache/include/compat/asprintf.h [new file with mode: 0644]
varnish-cache/include/compat/strlcat.h [new file with mode: 0644]
varnish-cache/include/compat/strlcpy.h [new file with mode: 0644]
varnish-cache/include/compat/vasprintf.h [new file with mode: 0644]
varnish-cache/lib/libcompat/asprintf.c
varnish-cache/lib/libcompat/strlcat.c
varnish-cache/lib/libcompat/strlcpy.c
varnish-cache/lib/libcompat/vasprintf.c
varnish-cache/lib/libvcl/vcc_compile.c

index 41918e4e70b16c141b96d867d939531151ee7d28..10345e0e19ba7e436402f15632de6d33b7b1eb1a 100644 (file)
@@ -13,7 +13,7 @@
 #include <string.h>
 #include <unistd.h>
 
-#include "compat.h"
+#include "compat/vasprintf.h"
 #include "cli_priv.h"
 #include "cli.h"
 #include "vsb.h"
index 95c7c6a8c09dd3bab416b6d29c338daf97bbdc6a..a9fa2495e5bb97cb995bcbbf8b5464653ca83a10 100644 (file)
@@ -11,7 +11,7 @@
 #include <string.h>
 #include <unistd.h>
 
-#include "compat.h"
+#include "compat/asprintf.h"
 #include "vsb.h"
 #include "queue.h"
 
index 47bb31cad4a05e212e54be2694d9ab2f901f051e..f16b8ae81ad888f6ec67271b641d8c1bd5ddc9d8 100644 (file)
@@ -19,7 +19,7 @@
 #include <string.h>
 #include <unistd.h>
 
-#include "compat.h"
+#include "compat/asprintf.h"
 #include "shmlog.h"
 #include "cache.h"
 
index 5df51724f7ebe6f1cbe1515eefa4334ffaac5d64..61a652721b38c2a5e05700b697ba0d3827fda24a 100644 (file)
@@ -10,6 +10,7 @@
 #include <stdio.h>
 #include <string.h>
 
+#include "compat/strlcpy.h"
 #include "heritage.h"
 #include "mgt.h"
 
index 2cfcef96a14bc5b96b6fc8a6a67e35dd861f38e6..36bd3fe99a835227a86912cc48931715b07aa632 100644 (file)
@@ -5,7 +5,10 @@ noinst_HEADERS = \
        cli.h \
        cli_common.h \
        cli_priv.h \
-       compat.h \
+       compat/asprintf.h \
+       compat/strlcat.h \
+       compat/strlcpy.h \
+       compat/vasprintf.h \
        hash.h \
        http_headers.h \
        libvarnish.h \
diff --git a/varnish-cache/include/compat.h b/varnish-cache/include/compat.h
deleted file mode 100644 (file)
index c6ff735..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * $Id$
- */
-
-#ifndef COMPAT_H_INCLUDED
-#define COMPAT_H_INCLUDED
-
-#ifndef HAVE_VASPRINTF
-#ifdef va_start /* make sure <stdarg.h> is in scope */
-int vasprintf(char **strp, const char *fmt, va_list ap);
-#endif
-#endif
-
-#ifndef HAVE_ASPRINTF
-int asprintf(char **strp, const char *fmt, ...);
-#endif
-
-#ifndef HAVE_STRLCPY
-size_t strlcpy(char *dst, const char *src, size_t size);
-#endif
-
-#ifndef HAVE_STRLCAT
-size_t strlcat(char *dst, const char *src, size_t size);
-#endif
-
-#endif
diff --git a/varnish-cache/include/compat/asprintf.h b/varnish-cache/include/compat/asprintf.h
new file mode 100644 (file)
index 0000000..70a596b
--- /dev/null
@@ -0,0 +1,12 @@
+/*
+ * $Id$
+ */
+
+#ifndef COMPAT_ASPRINTF_H_INCLUDED
+#define COMPAT_ASPRINTF_H_INCLUDED
+
+#ifndef HAVE_ASPRINTF
+int asprintf(char **strp, const char *fmt, ...);
+#endif
+
+#endif
diff --git a/varnish-cache/include/compat/strlcat.h b/varnish-cache/include/compat/strlcat.h
new file mode 100644 (file)
index 0000000..11b7566
--- /dev/null
@@ -0,0 +1,12 @@
+/*
+ * $Id$
+ */
+
+#ifndef COMPAT_STRLCAT_H_INCLUDED
+#define COMPAT_STRLCAT_H_INCLUDED
+
+#ifndef HAVE_STRLCAT
+size_t strlcat(char *dst, const char *src, size_t size);
+#endif
+
+#endif
diff --git a/varnish-cache/include/compat/strlcpy.h b/varnish-cache/include/compat/strlcpy.h
new file mode 100644 (file)
index 0000000..d6f252e
--- /dev/null
@@ -0,0 +1,12 @@
+/*
+ * $Id$
+ */
+
+#ifndef COMPAT_STRLCPY_H_INCLUDED
+#define COMPAT_STRLCPY_H_INCLUDED
+
+#ifndef HAVE_STRLCPY
+size_t strlcpy(char *dst, const char *src, size_t size);
+#endif
+
+#endif
diff --git a/varnish-cache/include/compat/vasprintf.h b/varnish-cache/include/compat/vasprintf.h
new file mode 100644 (file)
index 0000000..59104f1
--- /dev/null
@@ -0,0 +1,12 @@
+/*
+ * $Id$
+ */
+
+#ifndef COMPAT_VASPRINTF_H_INCLUDED
+#define COMPAT_VASPRINTF_H_INCLUDED
+
+#ifndef HAVE_VASPRINTF
+int vasprintf(char **strp, const char *fmt, va_list ap);
+#endif
+
+#endif
index 2347e327aa99f567c3855b370234277b0afd399d..266e99b200c6a4625b30392038f01220fd15126f 100644 (file)
@@ -3,12 +3,14 @@
  *
  */
 
+#ifndef HAVE_ASPRINTF
+
 #include <stdarg.h>
 #include <stdio.h>
 
-#include "compat.h"
+#include "compat/asprintf.h"
+#include "compat/vasprintf.h"
 
-#ifndef HAVE_ASPRINTF
 int
 asprintf(char **strp, const char *fmt, ...)
 {
index 21f09e7b18681437858321f6fa4b7e469881cba5..3dd45f877b44ae246fadbea3b2a6ba9f9516b9fa 100644 (file)
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+#ifndef HAVE_STRLCAT
+
 #include <sys/types.h>
 #include <string.h>
 
-#include "compat.h"
+#include "compat/strlcat.h"
 
-#ifndef HAVE_STRLCAT
 /*
  * Appends src to string dst of size siz (unlike strncat, siz is the
  * full size of dst, not space left).  At most siz-1 characters
index bf22e472fbdd1a8dcabc386e4c0632f5b2306f51..c8c5109b4a51855fdf24bfb9f8a9c645423d7218 100644 (file)
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+#ifndef HAVE_STRLCPY
+
 #include <sys/types.h>
 #include <string.h>
 
-#include "compat.h"
+#include "compat/strlcpy.h"
 
-#ifndef HAVE_STRLCPY
 /*
  * Copy src to string dst of size siz.  At most siz-1 characters
  * will be copied.  Always NUL terminates (unless siz == 0).
index 08fd699248630b4be1e6aac5693557fc900470ad..99b2df7fd06cf031db2554d6c6d2c2c5007b9a47 100644 (file)
@@ -3,13 +3,14 @@
  *
  */
 
+#ifndef HAVE_VASPRINTF
+
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "compat.h"
+#include "compat/vasprintf.h"
 
-#ifndef HAVE_VASPRINTF
 int
 vasprintf(char **strp, const char *fmt, va_list ap)
 {
index b5a4076555cbc4ac83c3e65fabcaf13969651033..29345998db92949e259349f396cfa7a29e30a3ef 100644 (file)
@@ -49,7 +49,7 @@
 #include <queue.h>
 #include <unistd.h>
 
-#include "compat.h"
+#include "compat/asprintf.h"
 #include "vsb.h"
 
 #include "vcc_priv.h"