X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=reentr.pl;h=ddbfab36f197b81006fbfb6700041e28b4c0739c;hb=d1bd4ef0a107c19b597b3c5d49a9b6836c36909f;hp=cdce54e53a850903dedbe0a6ff39585aaff08a4b;hpb=e06c4d37e9c075c9a909e0cdf8fdf9d851bbe1a4;p=p5sagit%2Fp5-mst-13.2.git diff --git a/reentr.pl b/reentr.pl index cdce54e..ddbfab3 100644 --- a/reentr.pl +++ b/reentr.pl @@ -42,13 +42,14 @@ my %map = ( safer_unlink 'reentr.h'; die "reentr.h: $!" unless open(H, ">reentr.h"); +binmode H; select H; print <. + */ + +#ifndef PERL_REENTR_API +# if defined(PERL_CORE) || defined(PERL_EXT) +# define PERL_REENTR_API 1 +# else +# define PERL_REENTR_API 0 +# endif +#endif + #ifdef USE_REENTRANT_API /* Deprecations: some platforms have the said reentrant interfaces * but they are declared obsolete and are not to be used. Often this * means that the platform has threadsafed the interfaces (hopefully). * All this is OS version dependent, so we are of course fooling ourselves. - * If you know of more deprecations on some platforms, please add your own. */ + * If you know of more deprecations on some platforms, please add your own + * (by editing reentr.pl, mind!) */ #ifdef __hpux # undef HAS_CRYPT_R @@ -93,9 +110,9 @@ 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; } @@ -347,7 +365,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); @@ -545,7 +563,7 @@ EOF push @size, <$sz = sysconf($sc); - if (PL_reentrant_buffer->$sz == -1) + if (PL_reentrant_buffer->$sz == (size_t) -1) PL_reentrant_buffer->$sz = REENTRANTUSUALSIZE; # else # if defined(__osf__) && defined(__alpha) && defined(SIABUFSIZ) @@ -595,7 +613,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, <_' . $genfunc . '_data))'; + $memzero = 'REENTR_MEMZERO(&PL_reentrant_buffer->_' . $genfunc . '_data, sizeof(PL_reentrant_buffer->_' . $genfunc . '_data)),'; } push @wrap, <reentr.c"); +binmode C; select C; print <op_type) { #ifdef USE_HOSTENT_BUFFER @@ -1046,9 +1074,11 @@ Perl_reentrant_retry(const char *f, ...) /* Not known how to retry, so just fail. */ break; } - - va_end(ap); +#else + PERL_UNUSED_ARG(f); #endif + } + va_end(ap); return retptr; }