Fix Encode 2.60 with g++
authorDavid Mitchell <davem@iabyn.com>
Thu, 8 May 2014 12:30:16 +0000 (13:30 +0100)
committerDavid Mitchell <davem@iabyn.com>
Thu, 8 May 2014 12:30:16 +0000 (13:30 +0100)
commit89c2544cd319141dbdce6c8408aa52896c2549f1
treefc1fb838597e216abd09e798fa557b57f714fccc
parentc7981a06d5acac597f1bcbdd7664eb04ee6ad5bd
Fix Encode 2.60 with g++

The recently added Encode 2.60 won't compile with g++, due to assigning
a const char * const pointer to a char* struct field.

The intent of the code itself is a bit unclear, but it appears to be
to set SvPVX as a read-only alias of a const string, using the SvLEN()=0
trick to avoid it being freed.

Fix the g++ builds by casting away the constness, and add some asserts and
comments to make it less unclear what's going on.
13 files changed:
Porting/Maintainers.pl
cpan/Encode/Byte/Makefile.PL
cpan/Encode/CN/Makefile.PL
cpan/Encode/EBCDIC/Makefile.PL
cpan/Encode/Encode.pm
cpan/Encode/Encode.xs
cpan/Encode/Encode/Makefile_PL.e2x
cpan/Encode/JP/Makefile.PL
cpan/Encode/KR/Makefile.PL
cpan/Encode/Symbol/Makefile.PL
cpan/Encode/TW/Makefile.PL
cpan/Encode/bin/enc2xs
t/porting/customized.dat