aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2020-03-27 11:08:49 +0200
committerSergey Poznyakoff <gray@gnu.org>2020-03-27 11:08:49 +0200
commit99b8dd21c7d1a91021b0a63c0d846ac35c4b0093 (patch)
tree65408aecc5f5eaebf31c74f007d0d497350f1b18
parentb68d558d7aef78eca1417e59ebb0ae38c276e9e0 (diff)
downloadacvmod-99b8dd21c7d1a91021b0a63c0d846ac35c4b0093.tar.gz
acvmod-99b8dd21c7d1a91021b0a63c0d846ac35c4b0093.tar.bz2
Install a workaround for disappearing/reappearing WS_Reserve* functions in 6.x
-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
@@ -116,6 +116,31 @@ AC_DEFUN([AM_VARNISHAPI],
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])
AC_ARG_WITH([vmoddir],

Return to:

Send suggestions and report system problems to the System administrator.