diff options
Diffstat (limited to 'varnishapi.m4')
-rw-r--r-- | varnishapi.m4 | 25 |
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]) |