From: Zefram Date: Sat, 7 Nov 2009 13:02:33 +0000 (+0000) Subject: C++ fail with KeywordRPN X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=58e85f6bd3e5ead9541e7b32918133d0e26f32e7;p=p5sagit%2Fp5-mst-13.2.git C++ fail with KeywordRPN A smoke using g++ has revealed: >KeywordRPN.c: In function 'void XS_XS__APItest__KeywordRPN_import(CV*)': >KeywordRPN.c:320: error: expected unqualified-id before 'class' >KeywordRPN.c:320: error: expected initializer before 'class' >KeywordRPN.c: In function 'void XS_XS__APItest__KeywordRPN_unimport(CV*)': >KeywordRPN.c:357: error: expected unqualified-id before 'class' >KeywordRPN.c:357: error: expected initializer before 'class' >make[1]: *** [KeywordRPN.o] Error 1 >Unsuccessful make(ext/XS-APItest-KeywordRPN): code=512 at make_ext.pl line 449. >make: *** [lib/auto/XS/APItest/KeywordRPN/KeywordRPN.so] Error 25 I used "class" as a variable name, but in C++ it's a keyword. Patch attached. Someone should also add a note about C++ compatibility to perlhack.pod. -zefram Signed-off-by: H.Merijn Brand --- diff --git a/ext/XS-APItest-KeywordRPN/KeywordRPN.pm b/ext/XS-APItest-KeywordRPN/KeywordRPN.pm index 085d3f6..7b8b8fb 100644 --- a/ext/XS-APItest-KeywordRPN/KeywordRPN.pm +++ b/ext/XS-APItest-KeywordRPN/KeywordRPN.pm @@ -84,7 +84,7 @@ package XS::APItest::KeywordRPN; use warnings; use strict; -our $VERSION = "0.000"; +our $VERSION = "0.001"; require XSLoader; XSLoader::load(__PACKAGE__, $VERSION); diff --git a/ext/XS-APItest-KeywordRPN/KeywordRPN.xs b/ext/XS-APItest-KeywordRPN/KeywordRPN.xs index 219d6ac..32b6998 100644 --- a/ext/XS-APItest-KeywordRPN/KeywordRPN.xs +++ b/ext/XS-APItest-KeywordRPN/KeywordRPN.xs @@ -247,7 +247,7 @@ BOOT: PL_keyword_plugin = my_keyword_plugin; void -import(SV *class, ...) +import(SV *classname, ...) PREINIT: int i; PPCODE: @@ -265,7 +265,7 @@ PPCODE: } void -unimport(SV *class, ...) +unimport(SV *classname, ...) PREINIT: int i; PPCODE: