summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org>2020-03-27 09:08:49 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2020-03-27 09:08:49 (GMT)
commit99b8dd21c7d1a91021b0a63c0d846ac35c4b0093 (patch) (side-by-side diff)
tree65408aecc5f5eaebf31c74f007d0d497350f1b18
parentb68d558d7aef78eca1417e59ebb0ae38c276e9e0 (diff)
downloadacvmod-99b8dd21c7d1a91021b0a63c0d846ac35c4b0093.tar.gz
acvmod-99b8dd21c7d1a91021b0a63c0d846ac35c4b0093.tar.bz2
Install a workaround for disappearing/reappearing WS_Reserve* functions in 6.x
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--varnishapi.m425
1 files changed, 25 insertions, 0 deletions
diff --git a/varnishapi.m4 b/varnishapi.m4
index 560d49b..6e47ae7 100644
--- a/varnishapi.m4
+++ b/varnishapi.m4
@@ -115,6 +115,31 @@ AC_DEFUN([AM_VARNISHAPI],
else
AC_MSG_ERROR([unknown varnishapi version])
fi
+
+ if test "$VARNISHAPI_MAJOR" -eq 6; then
+ save_cflags=$CFLAGS
+ CFLAGS=$VARNISHAPI_CFLAGS
+ AC_CHECK_DECLS([WS_ReserveAll,WS_ReserveSize],[],[],
+ [#include <cache/cache.h>
+#include <vcl.h>
+])
+ CFLAGS=$save_cflags
+ AH_BOTTOM([/*
+ * The two functions below appeared in 6.0 and were removed in
+ * versions 6.1 and 6.2 only to resurge in 6.3, with the additional
+ * notice that they are going to replace the WS_Reserve function,
+ * which will be removed after 2020-09-15.
+ * (see http://varnish-cache.org/docs/trunk/whats-new/upgrading-6.3.html)
+ * These macros work around this vacillation.
+ */
+#if !HAVE_DECL_WS_RESERVEALL
+# define WS_ReserveAll(ws) WS_Reserve(ws,0)
+#endif
+#if !HAVE_DECL_WS_RESERVESIZE
+# define WS_ReserveSize(ws,sz) WS_Reserve(ws,sz)
+#endif
+])
+ fi
# vmod installation dir
AC_ARG_VAR([VMODDIR], [vmod installation directory])

Return to:

Send suggestions and report system problems to the System administrator.