diff --git a/configure.in b/configure.in index 6e4851ad..eba8a7a3 100644 --- a/configure.in +++ b/configure.in @@ -783,6 +783,21 @@ if test "$enable_perl" = "yes"; then cf_result=yes, cf_result=no) fi +if test "$cf_result"; then AC_MSG_RESULT($cf_result); fi + +AC_MSG_CHECKING([whether POPpx works without an n_a variable]) +AC_TRY_COMPILE([ +#include +#include +extern PerlInterpreter *my_perl; +], + [dSP; (void) POPpx;], + [AC_MSG_RESULT([yes]) +AC_DEFINE([CONFIG_PERL_POPPX_WITHOUT_N_A], [1], + [Define if using Perl 5.8.8 or later, where the "POPpx" macro +no longer needs an "n_a" variable like it did in 5.8.7])], + [AC_MSG_RESULT([no])]) + if test "$cf_result" != "yes"; then EL_RESTORE_FLAGS else @@ -793,7 +808,6 @@ else AC_SUBST(PERL_CFLAGS) fi -if test "$cf_result"; then AC_MSG_RESULT($cf_result); fi dnl =================================================================== dnl Check for Python dnl =================================================================== diff --git a/src/scripting/perl/hooks.c b/src/scripting/perl/hooks.c index 9a833124..487945fa 100644 --- a/src/scripting/perl/hooks.c +++ b/src/scripting/perl/hooks.c @@ -44,6 +44,9 @@ do_script_hook_goto_url(struct session *ses, unsigned char **url) if (SvTRUE(ERRSV)) count = 0; /* FIXME: error message ? */ SPAGAIN; if (count == 1) { +#ifndef CONFIG_PERL_POPPX_WITHOUT_N_A + STRLEN n_a; /* Used by POPpx macro. */ +#endif unsigned char *new_url = POPpx; if (new_url) { @@ -89,6 +92,9 @@ do_script_hook_follow_url(unsigned char **url) if (SvTRUE(ERRSV)) count = 0; /* FIXME: error message ? */ SPAGAIN; if (count == 1) { +#ifndef CONFIG_PERL_POPPX_WITHOUT_N_A + STRLEN n_a; /* Used by POPpx macro. */ +#endif unsigned char *new_url = POPpx; if (new_url) { @@ -185,6 +191,9 @@ do_script_hook_get_proxy(unsigned char **new_proxy_url, unsigned char *url) (void) POPs; mem_free_set(new_proxy_url, NULL); } else { +#ifndef CONFIG_PERL_POPPX_WITHOUT_N_A + STRLEN n_a; /* Used by POPpx macro. */ +#endif unsigned char *new_url = POPpx; mem_free_set(new_proxy_url, stracpy(new_url));