mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Bug 788: Define n_a variables if the POPpx macro of Perl needs them.
The configure script checks whether it is possible to compile a use of POPpx without an n_a variable; if not, the source code then defines those variables. This is slower than including Perl's patchlevel.h and comparing the version numbers to 5.8.8 but I expect this to be more reliable as well.
This commit is contained in:
parent
e815e07179
commit
432969a3a9
16
configure.in
16
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 <EXTERN.h>
|
||||
#include <perl.h>
|
||||
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 ===================================================================
|
||||
|
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user