In perl.git, the branch nicholas/misc-tidyup has been updated <http://perl5.git.perl.org/perl.git/commitdiff/34b30241a338c1278a1cd6c77c521b4a89683791?hp=d1c33b406158bae9d8a75d8b27a6c0e01396498c>
- Log ----------------------------------------------------------------- commit 34b30241a338c1278a1cd6c77c521b4a89683791 Author: Nicholas Clark <[email protected]> Date: Tue Apr 17 21:41:04 2012 +0200 Various minor fixes to enable -DUSE_SFIO to compile again. Historically, stdio was "enabled" with -UUSE_PERLIO, PerlIO (proper) enabled with -DUSE_PERLIO, and sfio enabled with -DUSE_PERLIO && -DUSE_SFIO. Commit 39f7a87036eb8d13 in Apr 2003 introduced PerlIO::get_layers, but broke the build for stdio & sfio. Commit 5fef3b4a7f0c97d3, the next day, restored the build for stdio, but not for sfio. This is fixed with a 1 line change in universal.c Commit de009b76d60bdeb8 in Apr 2005 erroneously adds const to a variable which is not constant in PerlIO_findFILE(). As this was in code only conditionally compiled with -DUSE_SFIO it was not noticed. Commit 6cb8cb214e85c7d6 in Oct 2006 added PerlIO_teardown, which breaks the sfio build. A 1 line change in perl.h fixes this. Commit 4ee3916907333148 in Nov 2008 made a typo in code conditionally compiled with -DUSE_SFIO within Perl_write_to_stderr(). Commit 2e0cfa16dea85dd3 in Feb 2011 broke the build for stdio & sfio. Commit b6ae43b72863e12d in Mar 2011 restored the build for stdio, but not for sfio. This is fixed with a 1 line change in util.c Even with these changes, miniperl is unable to build all extensions in ext, dist and cpan, due to an undiagnosed bug which causes generated Makefiles to be truncated at 8192 bytes. Additionally, miniperl built with sfio fails many many tests for make minitest, and hangs for input on t/op/readline.t ----------------------------------------------------------------------- Summary of changes: perl.h | 2 +- perlio.c | 2 +- universal.c | 4 ++-- util.c | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/perl.h b/perl.h index e532af2..321df9e 100644 --- a/perl.h +++ b/perl.h @@ -4063,7 +4063,7 @@ typedef Sighandler_t Sigsave_t; # define RUNOPS_DEFAULT Perl_runops_standard #endif -#ifdef USE_PERLIO +#if defined(USE_PERLIO) && !defined(USE_SFIO) EXTERN_C void PerlIO_teardown(void); # ifdef USE_ITHREADS # define PERLIO_INIT MUTEX_INIT(&PL_perlio_mutex) diff --git a/perlio.c b/perlio.c index 7782728..8116894 100644 --- a/perlio.c +++ b/perlio.c @@ -433,7 +433,7 @@ FILE * PerlIO_findFILE(PerlIO *pio) { const int fd = PerlIO_fileno(pio); - FILE * const f = fdopen(fd, "r+"); + FILE * f = fdopen(fd, "r+"); PerlIO_flush(pio); if (!f && errno == EINVAL) f = fdopen(fd, "w"); diff --git a/universal.c b/universal.c index b3c7015..d38f08c 100644 --- a/universal.c +++ b/universal.c @@ -29,7 +29,7 @@ #define PERL_IN_UNIVERSAL_C #include "perl.h" -#ifdef USE_PERLIO +#if defined(USE_PERLIO) && !defined(USE_SFIO) #include "perliol.h" /* For the PERLIO_F_XXX */ #endif @@ -963,7 +963,7 @@ XS(XS_PerlIO_get_layers) dXSARGS; if (items < 1 || items % 2 == 0) croak_xs_usage(cv, "filehandle[,args]"); -#ifdef USE_PERLIO +#if defined(USE_PERLIO) && !defined(USE_SFIO) { SV * sv; GV * gv; diff --git a/util.c b/util.c index c7ddd73..ae6c56a 100644 --- a/util.c +++ b/util.c @@ -25,7 +25,7 @@ #define PERL_IN_UTIL_C #include "perl.h" -#ifdef USE_PERLIO +#if defined(USE_PERLIO) && !defined(USE_SFIO) #include "perliol.h" /* For PerlIOUnix_refcnt */ #endif @@ -1524,7 +1524,7 @@ Perl_write_to_stderr(pTHX_ SV* msv) else { #ifdef USE_SFIO /* SFIO can really mess with your errno */ - dSAVED_ERRNO; + dSAVE_ERRNO; #endif PerlIO * const serr = Perl_error_log; @@ -3224,7 +3224,7 @@ Perl_my_pclose(pTHX_ PerlIO *ptr) dSAVEDERRNO; const int fd = PerlIO_fileno(ptr); -#ifdef USE_PERLIO +#if defined(USE_PERLIO) && !defined(USE_SFIO) /* Find out whether the refcount is low enough for us to wait for the child proc without blocking. */ const bool should_wait = PerlIOUnix_refcnt(fd) == 1; -- Perl5 Master Repository
