now perl5.24 headers are really flaky....
I ended up with this error upgrading "my "perl ....
...
In file included from /usr/lib/x86_64-linux-gnu/perl/5.24/CORE/perl.h:
+3905:0,
from /home/christian/prj/ai/freeciv/dependencies/free
+civ/client/gui-swig/fc_swig_perl_side.h:53,
from /home/christian/prj/ai/freeciv/dependencies/free
+civ/client/gui-swig/fc_swig_cside.c:36:
/usr/lib/x86_64-linux-gnu/perl/5.24/CORE/inline.h: Dans la fonction «
+ S_cx_popsub_args »:
/usr/lib/x86_64-linux-gnu/perl/5.24/CORE/cop.h:612:13: erreur : decla
+ration of « av » shadows a previous local [-Werror=shadow]
AV *av = GvAV(PL_defgv);
+ \
^
/usr/lib/x86_64-linux-gnu/perl/5.24/CORE/cop.h:612:13: note : in defi
+nition of macro « CX_POP_SAVEARRAY »
AV *av = GvAV(PL_defgv);
+ \
^~
In file included from /usr/lib/x86_64-linux-gnu/perl/5.24/CORE/perl.h:
+5859:0,
from /home/christian/prj/ai/freeciv/dependencies/free
+civ/client/gui-swig/fc_swig_perl_side.h:53,
from /home/christian/prj/ai/freeciv/dependencies/free
+civ/client/gui-swig/fc_swig_cside.c:36:
/usr/lib/x86_64-linux-gnu/perl/5.24/CORE/inline.h:518:9: note : shado
+wed declaration is here
AV *av;
...
this does not happen when compiling C++ objects, (see header used below)
but just in C.
so , I prepend perl.h include with
#define PERL_NO_INLINE_FUNCTIONS 1
and all is back to normal ...
so, which monk needs to be excommunicated ?!
here is the header I now use ...
//....
#ifdef __cplusplus
#include <math.h>
#include <stdlib.h>
extern "C" {
#endif
#ifndef __cplusplus
#define PERL_NO_INLINE_FUNCTIONS 1
#endif
#include "EXTERN.h"
#if defined _
#undef _
#endif
#include "perl.h"
#include "XSUB.h"
#include <string.h>
#ifdef __cplusplus
}
#endif
by the way #define PERL_NO_INLINE_FUNCTIONS 1 will also not work alone:
we would be forced to make an use of S_croak_memory_wrap(),
PERL_STATIC_NO_RET void S_croak_memory_wrap(void) {Perl_croak_nocontex
+t("panic: memory wrap");}
and loose important inline macro... like....
S_SvREFCNT_inc()...