From 0166a0ec575e9e4d65719a94aef99427c2b05263 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Mon, 23 Mar 2020 17:52:55 +0200 Subject: Works with Varnish 6.3.2. Restore backward compatibility with <6.2 --- configure.ac | 2 +- src/vmod_geoip.c | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 903f270..a3ef08a 100644 --- a/configure.ac +++ b/configure.ac @@ -42,7 +42,7 @@ AC_PROG_MAKE_SET AC_HEADER_STDC AC_CHECK_HEADERS([sys/stdlib.h]) -AM_VARNISHAPI([5.1], [6.3.1]) +AM_VARNISHAPI([5.1], [6.3.2]) AC_DEFINE_UNQUOTED([VARNISHAPI_MAJOR],[$VARNISHAPI_MAJOR], [Varnish API major version number]) diff --git a/src/vmod_geoip.c b/src/vmod_geoip.c index 47729fa..de26eea 100644 --- a/src/vmod_geoip.c +++ b/src/vmod_geoip.c @@ -19,6 +19,14 @@ # include # include #endif + +#ifdef VPFX +# define VEVENT(a) VPFX(a) +#else +/* For compatibility with varnish prior to 6.2 */ +# define VEVENT(a) a +#endif + #include #include @@ -41,7 +49,7 @@ free_conf(void *data) } int -vmod_geoip_event(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e) +VEVENT(geoip_event)(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e) { if (e == VCL_EVENT_LOAD) { struct geoip_config *conf = calloc(1, sizeof(*conf)); -- cgit v1.2.1