Subject: | Replace INIT/PREINIT to allow compilation with older compilers |
On systems with older compilers, which don't handle variable
declarations mid-code, 'make' will stop compiling Cache::Memcached::XS
with the following message:
XS.xs: In function `XS_Cache__Memcached__XS_mc_set':
XS.xs:103: parse error before `char'
XS.xs:106: `val' undeclared (first use in this function)
...
The attached patch fixes this by replacing all INIT: sections in XS.xs
containing variable declarations by PREINIT: sections.
-- Mike
Mike Schilli
Subject: | patch.txt |
diff -Naur XS.xs XS.xs
--- XS.xs Sun Jul 2 15:55:00 2006
+++ XS.xs Thu Aug 17 12:46:21 2006
@@ -99,7 +99,7 @@
SV *val_sv;
int exp;
int flags;
- INIT:
+ PREINIT:
char *val;
int len;
CODE:
@@ -115,7 +115,7 @@
SV *val_sv;
int exp;
int flags;
- INIT:
+ PREINIT:
char *val;
int len;
CODE:
@@ -131,7 +131,7 @@
SV *val_sv;
int exp;
int flags;
- INIT:
+ PREINIT:
char *val;
int len;
CODE: