X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=reentr.pl;h=58a574e2ff82dd1ff792aec30cdacee7e7a1a783;hb=4608196e45589eea5792cff92b551109899ddb06;hp=cd6998990cfbf7a9d90d4552eae428d045fe7a5a;hpb=23e2b7a9cd174dbd4e526e1069d671e42c30d954;p=p5sagit%2Fp5-mst-13.2.git diff --git a/reentr.pl b/reentr.pl index cd69989..58a574e 100644 --- a/reentr.pl +++ b/reentr.pl @@ -5,6 +5,11 @@ # and optionally also the relevant metaconfig units (-U option). # +BEGIN { + # Get function prototypes + require 'regen_lib.pl'; +} + use strict; use Getopt::Std; my %opts; @@ -35,13 +40,16 @@ my %map = ( # Example #3: S_CBI means type func_r(const char*, char*, int) +safer_unlink 'reentr.h'; die "reentr.h: $!" unless open(H, ">reentr.h"); +binmode H; select H; print <) { # Read in the protypes. # If given the -U option open up the metaconfig unit for this function. if ($opts{U} && open(U, ">d_${func}_r.U")) { + binmode U; select U; } @@ -340,7 +349,7 @@ sub pushssif { sub pushinitfree { my $func = shift; push @init, <_${func}_buffer, PL_reentrant_buffer->_${func}_size, char); + Newx(PL_reentrant_buffer->_${func}_buffer, PL_reentrant_buffer->_${func}_size, char); EOF push @free, <_${func}_buffer); @@ -588,7 +597,7 @@ EOF EOF push @init, <_${genfunc}_buffer, PL_reentrant_buffer->_${genfunc}_size, char); + Newx(PL_reentrant_buffer->_${genfunc}_buffer, PL_reentrant_buffer->_${genfunc}_size, char); #endif EOF push @free, <reentr.c"); +binmode C; select C; print <