X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/b8dcbfa5abb61b30000a64f9600fa0363796efca..3fb2f3ac5c8ed8e4fdad7a9dbbce30a09d4f93f7:/reentr.pl diff --git a/reentr.pl b/reentr.pl index a16f33c..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, <