From 786296d4896f80d498b17d1ae46dc0aa4fde5770 Mon Sep 17 00:00:00 2001 From: "Craig A. Berry" Date: Fri, 17 Jul 2015 17:53:54 -0500 Subject: Evict PERLIO_IS_STDIO from top-level core files. Configuring with perlio has been the only option since dd35fa16610 in 2011, first released in 5.16.0. Yet we have still have had all this dead code for stdio support cluttering up the sources and dulling the machetes of anyone who wants to do further work on perlio or someone (like me) who just stumbles on some code that looks like it needs fixing but isn't worth the time since the compiler will never see it. Leave a vestigial perlsdio.h since its presence is hard-coded in a number of places. --- perlio.h | 54 +++++++++++++----------------------------------------- 1 file changed, 13 insertions(+), 41 deletions(-) (limited to 'perlio.h') diff --git a/perlio.h b/perlio.h index 8e700fee83..1a3d480f43 100644 --- a/perlio.h +++ b/perlio.h @@ -13,41 +13,23 @@ /* Interface for perl to IO functions. There is a hierarchy of Configure determined #define controls: - USE_STDIO - forces PerlIO_xxx() to be #define-d onto stdio functions. - This is used for conservative - builds - "just like perl5.00X used to be". - This dominates over the others. + USE_STDIO - No longer available via Configure. Formerly forced + PerlIO_xxx() to be #define-d onto stdio functions. + Now generates compile-time error. USE_PERLIO - The primary Configure variable that enables PerlIO. - If USE_PERLIO is _NOT_ set - then USE_STDIO above will be set to be conservative. PerlIO_xxx() are real functions defined in perlio.c which implement extra functionality required for utf8 support. - One further note - the table-of-functions scheme controlled - by PERL_IMPLICIT_SYS turns on USE_PERLIO so that iperlsys.h can - #define PerlIO_xxx() to go via the function table, without having - to #undef them from (say) stdio forms. - */ -#if defined(PERL_IMPLICIT_SYS) -#ifndef USE_PERLIO -#ifndef NETWARE -/* # define USE_PERLIO */ -#endif -#endif -#endif - #ifndef USE_PERLIO # define USE_STDIO #endif #ifdef USE_STDIO -# ifndef PERLIO_IS_STDIO -# define PERLIO_IS_STDIO -# endif +# error "stdio is no longer supported as the default base layer -- use perlio." #endif /* -------------------- End of Configure controls ---------------------------- */ @@ -71,11 +53,6 @@ #undef O_BINARY #endif -#ifdef PERLIO_IS_STDIO -/* #define PerlIO_xxxx() as equivalent stdio function */ -#include "perlsdio.h" -#endif /* PERLIO_IS_STDIO */ - #ifndef PerlIO /* ----------- PerlIO implementation ---------- */ /* PerlIO not #define-d to something else - define the implementation */ @@ -111,27 +88,24 @@ PERL_CALLCONV void PerlIO_clone(pTHX_ PerlInterpreter *proto, /* ----------- End of implementation choices ---------- */ -#ifndef PERLIO_IS_STDIO -/* Not using stdio _directly_ as PerlIO */ - /* We now need to determine what happens if source trys to use stdio. * There are three cases based on PERLIO_NOT_STDIO which XS code * can set how it wants. */ -# ifdef PERL_CORE +#ifdef PERL_CORE /* Make a choice for perl core code - currently this is set to try and catch lingering raw stdio calls. This is a known issue with some non UNIX ports which still use "native" stdio features. */ -# ifndef PERLIO_NOT_STDIO -# define PERLIO_NOT_STDIO 1 -# endif - #else -# ifndef PERLIO_NOT_STDIO -# define PERLIO_NOT_STDIO 0 -# endif +# ifndef PERLIO_NOT_STDIO +# define PERLIO_NOT_STDIO 1 +# endif +#else +# ifndef PERLIO_NOT_STDIO +# define PERLIO_NOT_STDIO 0 +# endif #endif #ifdef PERLIO_NOT_STDIO @@ -154,7 +128,6 @@ PERL_CALLCONV void PerlIO_clone(pTHX_ PerlInterpreter *proto, */ #include "fakesdio.h" #endif /* ifndef PERLIO_NOT_STDIO */ -#endif /* PERLIO_IS_STDIO */ /* ----------- fill in things that have not got #define'd ---------- */ @@ -331,7 +304,7 @@ PERL_CALLCONV int PerlIO_setpos(PerlIO *, SV *); #ifndef PerlIO_fdupopen PERL_CALLCONV PerlIO *PerlIO_fdupopen(pTHX_ PerlIO *, CLONE_PARAMS *, int); #endif -#if !defined(PerlIO_modestr) && !defined(PERLIO_IS_STDIO) +#if !defined(PerlIO_modestr) PERL_CALLCONV char *PerlIO_modestr(PerlIO *, char *buf); #endif #ifndef PerlIO_isutf8 @@ -360,7 +333,6 @@ PERL_CALLCONV void PerlIO_debug(const char *fmt, ...) __attribute__format__(__printf__, 1, 2); typedef struct PerlIO_list_s PerlIO_list_t; - #endif END_EXTERN_C -- cgit v1.2.1