X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=reentr.pl;h=049b06eed1d0dd1a8c0f882e360287b18230a681;hb=b0d07b4e8d25114701bc6954107375b0bddf5764;hp=e1cee6f3ceb46945e6b113397bb4afcf7e8cce12;hpb=0eb6355a4410699750ec3d1b3a23891052a0ad29;p=p5sagit%2Fp5-mst-13.2.git diff --git a/reentr.pl b/reentr.pl index e1cee6f..049b06e 100644 --- a/reentr.pl +++ b/reentr.pl @@ -49,7 +49,7 @@ 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 @@ -94,9 +110,9 @@ print <_${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); @@ -547,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) @@ -597,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, <