From 7ea3dd8439cf29a3d3415e451d07c617a030bd85 Mon Sep 17 00:00:00 2001 From: Leon Timmermans Date: Sun, 20 Jun 2021 17:30:18 +0200 Subject: [PATCH] Remove :win32 PerlIO layer --- MANIFEST | 1 - lib/PerlIO.pm | 8 +- lib/warnings.pm | 87 +++++---- perlio.c | 6 - perliol.h | 3 - pod/perldiag.pod | 8 - pod/perlexperiment.pod | 10 -- pod/perlrun.pod | 11 +- regen/warnings.pl | 4 +- t/lib/warnings/perlio | 14 -- warnings.h | 26 ++- win32/GNUmakefile | 6 - win32/Makefile | 1 - win32/win32io.c | 391 ----------------------------------------- 14 files changed, 56 insertions(+), 520 deletions(-) delete mode 100644 win32/win32io.c diff --git a/MANIFEST b/MANIFEST index 5583c0b0794e..f3b567e23093 100644 --- a/MANIFEST +++ b/MANIFEST @@ -6297,7 +6297,6 @@ win32/vdir.h Perl "host" virtual directory manager for Win32 win32/vmem.h Perl "host" memory manager for Win32 win32/win32.c Win32 port win32/win32.h Win32 port -win32/win32io.c Win32 PerlIO layer support win32/win32iop.h Win32 port win32/win32sck.c Win32 port win32/win32thread.c Win32 functions for threads diff --git a/lib/PerlIO.pm b/lib/PerlIO.pm index 85dd083cc02a..01a02cf6486a 100644 --- a/lib/PerlIO.pm +++ b/lib/PerlIO.pm @@ -1,6 +1,6 @@ package PerlIO; -our $VERSION = '1.11'; +our $VERSION = '1.12'; # Map layer name to package that defines it our %alias; @@ -235,12 +235,6 @@ like C<:utf8>. An example of a possible use might be: A more elegant (and safer) interface is needed. -=item :win32 - -On Win32 platforms this I layer uses the native "handle" IO -rather than the unix-like numeric file descriptor layer. Known to be -buggy as of Perl 5.8.2. - =back =head2 Custom Layers diff --git a/lib/warnings.pm b/lib/warnings.pm index a92d4904c2da..1bd2dc28256e 100644 --- a/lib/warnings.pm +++ b/lib/warnings.pm @@ -5,7 +5,7 @@ package warnings; -our $VERSION = "1.51"; +our $VERSION = "1.52"; # Verify that we're called correctly so that warnings will work. # Can't use Carp, since Carp uses us! @@ -89,29 +89,28 @@ our %Offsets = ( 'experimental::const_attr' => 118, 'experimental::re_strict' => 120, 'experimental::refaliasing' => 122, - 'experimental::win32_perlio' => 124, - 'locale' => 126, - 'missing' => 128, - 'redundant' => 130, + 'locale' => 124, + 'missing' => 126, + 'redundant' => 128, # Warnings Categories added in Perl 5.025 - 'experimental::declared_refs' => 132, + 'experimental::declared_refs' => 130, # Warnings Categories added in Perl 5.027 - 'experimental::alpha_assertions' => 134, - 'experimental::script_run' => 136, - 'shadow' => 138, + 'experimental::alpha_assertions' => 132, + 'experimental::script_run' => 134, + 'shadow' => 136, # Warnings Categories added in Perl 5.029 - 'experimental::private_use' => 140, - 'experimental::uniprop_wildcards' => 142, - 'experimental::vlb' => 144, + 'experimental::private_use' => 138, + 'experimental::uniprop_wildcards' => 140, + 'experimental::vlb' => 142, # Warnings Categories added in Perl 5.031 - 'experimental::isa' => 146, + 'experimental::isa' => 144, # Warnings Categories added in Perl 5.033 - 'experimental::try' => 148, + 'experimental::try' => 146, ); our %Bits = ( @@ -125,25 +124,24 @@ our %Bits = ( 'digit' => "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [31] 'exec' => "\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [7] 'exiting' => "\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [3] - 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x55\x51\x15\x50\x51\x15", # [51..56,58..62,66..68,70..74] - 'experimental::alpha_assertions' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00", # [67] + 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x55\x51\x05\x54\x54\x05", # [51..56,58..61,65..67,69..73] + 'experimental::alpha_assertions' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00", # [66] 'experimental::bitwise' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00", # [58] 'experimental::const_attr' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00", # [59] - 'experimental::declared_refs' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00", # [66] - 'experimental::isa' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04", # [73] + 'experimental::declared_refs' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00", # [65] + 'experimental::isa' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01", # [72] 'experimental::lexical_subs' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00", # [52] 'experimental::postderef' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00", # [55] - 'experimental::private_use' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00", # [70] + 'experimental::private_use' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00", # [69] 'experimental::re_strict' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00", # [60] 'experimental::refaliasing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00", # [61] 'experimental::regex_sets' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00", # [53] - 'experimental::script_run' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00", # [68] + 'experimental::script_run' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00", # [67] 'experimental::signatures' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00", # [56] 'experimental::smartmatch' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00", # [54] - 'experimental::try' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10", # [74] - 'experimental::uniprop_wildcards' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00", # [71] - 'experimental::vlb' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01", # [72] - 'experimental::win32_perlio' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00", # [62] + 'experimental::try' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04", # [73] + 'experimental::uniprop_wildcards' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00", # [70] + 'experimental::vlb' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00", # [71] 'glob' => "\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [4] 'illegalproto' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00", # [47] 'imprecision' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00", # [46] @@ -151,10 +149,10 @@ our %Bits = ( 'internal' => "\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [24] 'io' => "\x00\x54\x55\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00", # [5..11,57] 'layer' => "\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [8] - 'locale' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00", # [63] + 'locale' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00", # [62] 'malloc' => "\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [25] 'misc' => "\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [12] - 'missing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00", # [64] + 'missing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00", # [63] 'newline' => "\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [9] 'non_unicode' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00", # [48] 'nonchar' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00", # [49] @@ -171,12 +169,12 @@ our %Bits = ( 'qw' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [36] 'recursion' => "\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [18] 'redefine' => "\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [19] - 'redundant' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00", # [65] + 'redundant' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00", # [64] 'regexp' => "\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [20] 'reserved' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [37] 'semicolon' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [38] 'severe' => "\x00\x00\x00\x00\x00\x54\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [21..25] - 'shadow' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00", # [69] + 'shadow' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00", # [68] 'signal' => "\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [26] 'substr' => "\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [27] 'surrogate' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00", # [50] @@ -203,25 +201,24 @@ our %DeadBits = ( 'digit' => "\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [31] 'exec' => "\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [7] 'exiting' => "\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [3] - 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\xaa\xa2\x2a\xa0\xa2\x2a", # [51..56,58..62,66..68,70..74] - 'experimental::alpha_assertions' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00", # [67] + 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\xaa\xa2\x0a\xa8\xa8\x0a", # [51..56,58..61,65..67,69..73] + 'experimental::alpha_assertions' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00", # [66] 'experimental::bitwise' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00", # [58] 'experimental::const_attr' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00", # [59] - 'experimental::declared_refs' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00", # [66] - 'experimental::isa' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08", # [73] + 'experimental::declared_refs' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00", # [65] + 'experimental::isa' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02", # [72] 'experimental::lexical_subs' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00", # [52] 'experimental::postderef' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00", # [55] - 'experimental::private_use' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00", # [70] + 'experimental::private_use' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00", # [69] 'experimental::re_strict' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00", # [60] 'experimental::refaliasing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00", # [61] 'experimental::regex_sets' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00", # [53] - 'experimental::script_run' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00", # [68] + 'experimental::script_run' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00", # [67] 'experimental::signatures' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00", # [56] 'experimental::smartmatch' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00", # [54] - 'experimental::try' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20", # [74] - 'experimental::uniprop_wildcards' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00", # [71] - 'experimental::vlb' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02", # [72] - 'experimental::win32_perlio' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00", # [62] + 'experimental::try' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08", # [73] + 'experimental::uniprop_wildcards' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00", # [70] + 'experimental::vlb' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00", # [71] 'glob' => "\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [4] 'illegalproto' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00", # [47] 'imprecision' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00", # [46] @@ -229,10 +226,10 @@ our %DeadBits = ( 'internal' => "\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [24] 'io' => "\x00\xa8\xaa\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00", # [5..11,57] 'layer' => "\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [8] - 'locale' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00", # [63] + 'locale' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00", # [62] 'malloc' => "\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [25] 'misc' => "\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [12] - 'missing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00", # [64] + 'missing' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00", # [63] 'newline' => "\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [9] 'non_unicode' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00", # [48] 'nonchar' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00", # [49] @@ -249,12 +246,12 @@ our %DeadBits = ( 'qw' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [36] 'recursion' => "\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [18] 'redefine' => "\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [19] - 'redundant' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00", # [65] + 'redundant' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00", # [64] 'regexp' => "\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [20] 'reserved' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [37] 'semicolon' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [38] 'severe' => "\x00\x00\x00\x00\x00\xa8\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [21..25] - 'shadow' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00", # [69] + 'shadow' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00", # [68] 'signal' => "\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [26] 'substr' => "\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [27] 'surrogate' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00", # [50] @@ -272,8 +269,8 @@ our %DeadBits = ( # These are used by various things, including our own tests our $NONE = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; -our $DEFAULT = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x00\x55\x51\x55\x50\x51\x15"; # [2,4,22,23,25,52..56,58..63,66..68,70..74] -our $LAST_BIT = 150 ; +our $DEFAULT = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x00\x55\x51\x15\x54\x54\x05"; # [2,4,22,23,25,52..56,58..62,65..67,69..73] +our $LAST_BIT = 148 ; our $BYTES = 19 ; sub Croaker @@ -898,8 +895,6 @@ The current hierarchy is: | +- experimental::uniprop_wildcards | | | +- experimental::vlb - | | - | +- experimental::win32_perlio | +- glob | diff --git a/perlio.c b/perlio.c index 6e3f4cffab82..7544d0472138 100644 --- a/perlio.c +++ b/perlio.c @@ -1064,12 +1064,6 @@ PerlIO_default_layers(pTHX) PERLIO_FUNCS_DECL(*osLayer) = &PerlIO_unix; PL_def_layerlist = PerlIO_list_alloc(aTHX); PerlIO_define_layer(aTHX_ PERLIO_FUNCS_CAST(&PerlIO_unix)); -#if defined(WIN32) - PerlIO_define_layer(aTHX_ PERLIO_FUNCS_CAST(&PerlIO_win32)); -# if 0 - osLayer = &PerlIO_win32; -# endif -#endif PerlIO_define_layer(aTHX_ PERLIO_FUNCS_CAST(&PerlIO_raw)); PerlIO_define_layer(aTHX_ PERLIO_FUNCS_CAST(&PerlIO_perlio)); PerlIO_define_layer(aTHX_ PERLIO_FUNCS_CAST(&PerlIO_stdio)); diff --git a/perliol.h b/perliol.h index 691e09533f78..e247ad60dde1 100644 --- a/perliol.h +++ b/perliol.h @@ -114,9 +114,6 @@ EXTCONST PerlIO_funcs PerlIO_utf8; EXTCONST PerlIO_funcs PerlIO_byte; EXTCONST PerlIO_funcs PerlIO_raw; EXTCONST PerlIO_funcs PerlIO_pending; -#ifdef WIN32 -EXTCONST PerlIO_funcs PerlIO_win32; -#endif PERL_CALLCONV PerlIO *PerlIO_allocate(pTHX); PERL_CALLCONV SV *PerlIO_arg_fetch(PerlIO_list_t *av, IV n); #define PerlIOArg PerlIO_arg_fetch(layers,n) diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 88df9485059e..df537e0bc433 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -4942,14 +4942,6 @@ and there is a bug in Perl in which the built-in regular expression folding rules are not accurate. This may lead to incorrect results. Please report this as a bug to L. -=item PerlIO layer ':win32' is experimental - -(S experimental::win32_perlio) The C<:win32> PerlIO layer is -experimental. If you want to take the risk of using this layer, -simply disable this warning: - - no warnings "experimental::win32_perlio"; - =item Perl_my_%s() not available (F) Your platform has very uncommon byte-order and integer size, diff --git a/pod/perlexperiment.pod b/pod/perlexperiment.pod index a191f70c3d7e..c2fb61a5e33b 100644 --- a/pod/perlexperiment.pod +++ b/pod/perlexperiment.pod @@ -95,16 +95,6 @@ L<[perl #18755]|https://github.com/Perl/perl5/issues/18755> See L -=item The <:win32> IO pseudolayer - -Using this feature triggers warnings in the category -C. - -The ticket for this experiment is -L<[perl #13198]|https://github.com/Perl/perl5/issues/13198>. - -See also L - =item Declaring a reference to a variable Introduced in Perl 5.26.0 diff --git a/pod/perlrun.pod b/pod/perlrun.pod index 5d3aa3eb3c47..dfefeb5beb88 100644 --- a/pod/perlrun.pod +++ b/pod/perlrun.pod @@ -1098,13 +1098,6 @@ X<:unix> Low-level layer that calls C, C, C, etc. -=item :win32 -X<:win32> - -On Win32 platforms this I layer uses native "handle" IO -rather than a Unix-like numeric file descriptor layer. Known to be -buggy in this release (5.30). - =back The default set of layers should give acceptable results on all platforms. @@ -1120,9 +1113,7 @@ on the version and vendor of the C compiler. Using our own C<:crlf> layer as the buffer avoids those issues and makes things more uniform. This release (5.30) uses C<:unix> as the bottom layer on Win32, and so still -uses the C compiler's numeric file descriptor routines. There is an -experimental native C<:win32> layer, which is expected to be enhanced and -may eventually become the default under Win32. +uses the C compiler's numeric file descriptor routines. The PERLIO environment variable is completely ignored when Perl is run in taint mode. diff --git a/regen/warnings.pl b/regen/warnings.pl index c4d6b4e7b914..b0537f9ee1ca 100644 --- a/regen/warnings.pl +++ b/regen/warnings.pl @@ -16,7 +16,7 @@ # # This script is normally invoked from regen.pl. -$VERSION = '1.51'; +$VERSION = '1.52'; BEGIN { require './regen/regen_lib.pl'; @@ -95,8 +95,6 @@ BEGIN [ 5.019, DEFAULT_ON ], 'experimental::signatures' => [ 5.019, DEFAULT_ON ], - 'experimental::win32_perlio' => - [ 5.021, DEFAULT_ON ], 'experimental::refaliasing' => [ 5.021, DEFAULT_ON ], 'experimental::re_strict' => diff --git a/t/lib/warnings/perlio b/t/lib/warnings/perlio index 2be984ff6c7e..0ccc5a884f43 100644 --- a/t/lib/warnings/perlio +++ b/t/lib/warnings/perlio @@ -56,17 +56,3 @@ close F; END { 1 while unlink "bb" } # KEEP THIS WITH THE LAST TEST. EXPECT Unknown PerlIO layer "xyz" at - line 5. -######## -# NAME :win32 experimental warning -# SKIP ?$^O ne "MSWin32" && ":win32 only available on Win32" -open my $fh, ">:win32", "temp.txt" or die $^E; -END { unlink "temp.txt"; } -EXPECT -PerlIO layer ':win32' is experimental at - line 1. -######## -# NAME :win32 experimental warning disabled -# SKIP ?$^O ne "MSWin32" && ":win32 only available on Win32" -no warnings "experimental::win32_perlio"; -open my $fh, ">:win32", "temp.txt" or die $^E; -END { unlink "temp.txt"; } -EXPECT diff --git a/warnings.h b/warnings.h index 5547a1161a95..4cb6a4e3c6ac 100644 --- a/warnings.h +++ b/warnings.h @@ -106,34 +106,33 @@ #define WARN_EXPERIMENTAL__CONST_ATTR 59 #define WARN_EXPERIMENTAL__RE_STRICT 60 #define WARN_EXPERIMENTAL__REFALIASING 61 -#define WARN_EXPERIMENTAL__WIN32_PERLIO 62 -#define WARN_LOCALE 63 -#define WARN_MISSING 64 -#define WARN_REDUNDANT 65 +#define WARN_LOCALE 62 +#define WARN_MISSING 63 +#define WARN_REDUNDANT 64 /* Warnings Categories added in Perl 5.025 */ -#define WARN_EXPERIMENTAL__DECLARED_REFS 66 +#define WARN_EXPERIMENTAL__DECLARED_REFS 65 /* Warnings Categories added in Perl 5.027 */ -#define WARN_EXPERIMENTAL__ALPHA_ASSERTIONS 67 -#define WARN_EXPERIMENTAL__SCRIPT_RUN 68 -#define WARN_SHADOW 69 +#define WARN_EXPERIMENTAL__ALPHA_ASSERTIONS 66 +#define WARN_EXPERIMENTAL__SCRIPT_RUN 67 +#define WARN_SHADOW 68 /* Warnings Categories added in Perl 5.029 */ -#define WARN_EXPERIMENTAL__PRIVATE_USE 70 -#define WARN_EXPERIMENTAL__UNIPROP_WILDCARDS 71 -#define WARN_EXPERIMENTAL__VLB 72 +#define WARN_EXPERIMENTAL__PRIVATE_USE 69 +#define WARN_EXPERIMENTAL__UNIPROP_WILDCARDS 70 +#define WARN_EXPERIMENTAL__VLB 71 /* Warnings Categories added in Perl 5.031 */ -#define WARN_EXPERIMENTAL__ISA 73 +#define WARN_EXPERIMENTAL__ISA 72 /* Warnings Categories added in Perl 5.033 */ -#define WARN_EXPERIMENTAL__TRY 74 +#define WARN_EXPERIMENTAL__TRY 73 #define WARNsize 19 #define WARN_ALLstring "\125\125\125\125\125\125\125\125\125\125\125\125\125\125\125\125\125\125\125" #define WARN_NONEstring "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" @@ -305,7 +304,6 @@ category parameters passed. =for apidoc Amnh||WARN_EXPERIMENTAL__CONST_ATTR =for apidoc Amnh||WARN_EXPERIMENTAL__RE_STRICT =for apidoc Amnh||WARN_EXPERIMENTAL__REFALIASING -=for apidoc Amnh||WARN_EXPERIMENTAL__WIN32_PERLIO =for apidoc Amnh||WARN_LOCALE =for apidoc Amnh||WARN_MISSING =for apidoc Amnh||WARN_REDUNDANT diff --git a/win32/GNUmakefile b/win32/GNUmakefile index e25cb7b995ee..8177dd5311a0 100644 --- a/win32/GNUmakefile +++ b/win32/GNUmakefile @@ -1108,12 +1108,6 @@ WIN32_SRC = \ .\win32thread.c \ .\fcrypt.c -# We need this for miniperl build unless we override canned -# config.h #define building mini\* -#ifeq ($(USE_PERLIO)" == "define" -WIN32_SRC += .\win32io.c -#endif - CORE_NOCFG_H = \ ..\av.h \ ..\cop.h \ diff --git a/win32/Makefile b/win32/Makefile index fa88f7262d44..6a56513af79c 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -794,7 +794,6 @@ EXTRACORE_SRC = $(EXTRACORE_SRC) ..\perlio.c WIN32_SRC = \ .\win32.c \ - .\win32io.c \ .\win32sck.c \ .\win32thread.c \ .\fcrypt.c diff --git a/win32/win32io.c b/win32/win32io.c deleted file mode 100644 index 2b4f27611dab..000000000000 --- a/win32/win32io.c +++ /dev/null @@ -1,391 +0,0 @@ -#define PERL_NO_GET_CONTEXT -#define WIN32_LEAN_AND_MEAN -#define WIN32IO_IS_STDIO -#include -#ifdef __GNUC__ -#define Win32_Winsock -#endif -#include - -#include -#include "EXTERN.h" -#include "perl.h" - -#ifdef PERLIO_LAYERS - -#include "perliol.h" - -#define NO_XSLOCKS -#include "XSUB.h" - - -/* Bottom-most level for Win32 case */ - -typedef struct -{ - struct _PerlIO base; /* The generic part */ - HANDLE h; /* OS level handle */ - IV refcnt; /* REFCNT for the "fd" this represents */ - int fd; /* UNIX like file descriptor - index into fdtable */ -} PerlIOWin32; - -PerlIOWin32 *fdtable[256]; -IV max_open_fd = -1; - -IV -PerlIOWin32_popped(pTHX_ PerlIO *f) -{ - PerlIOWin32 *s = PerlIOSelf(f,PerlIOWin32); - if (--s->refcnt > 0) - { - *f = PerlIOBase(f)->next; - return 1; - } - fdtable[s->fd] = NULL; - return 0; -} - -IV -PerlIOWin32_fileno(pTHX_ PerlIO *f) -{ - return PerlIOSelf(f,PerlIOWin32)->fd; -} - -IV -PerlIOWin32_pushed(pTHX_ PerlIO *f, const char *mode, SV *arg, PerlIO_funcs *tab) -{ - IV code = PerlIOBase_pushed(aTHX_ f,mode,arg,tab); - if (*PerlIONext(f)) - { - PerlIOWin32 *s = PerlIOSelf(f,PerlIOWin32); - s->fd = PerlIO_fileno(PerlIONext(f)); - } - PerlIOBase(f)->flags |= PERLIO_F_OPEN; - - Perl_ck_warner_d(aTHX_ - packWARN(WARN_EXPERIMENTAL__WIN32_PERLIO), - "PerlIO layer ':win32' is experimental"); - - return code; -} - -PerlIO * -PerlIOWin32_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers, IV n, const char *mode, int fd, int imode, int perm, PerlIO *f, int narg, SV **args) -{ - const char *tmode = mode; - HANDLE h = INVALID_HANDLE_VALUE; - if (f) - { - /* Close if already open */ - if (PerlIOBase(f)->flags & PERLIO_F_OPEN) - (*PerlIOBase(f)->tab->Close)(aTHX_ f); - } - if (narg > 0) - { - char *path = SvPV_nolen(*args); - DWORD access = 0; - /* CRT uses _SH_DENYNO for open(), this the Win32 equivelent */ - DWORD share = FILE_SHARE_READ | FILE_SHARE_WRITE; - DWORD create = -1; - DWORD attr = FILE_ATTRIBUTE_NORMAL; - if (stricmp(path, "/dev/null")==0) - path = "NUL"; - if (*mode == '#') - { - /* sysopen - imode is UNIX-like O_RDONLY etc. - - do_open has converted that back to string form in mode as well - - perm is UNIX like permissions - */ - mode++; - } - else - { - /* Normal open - decode mode string */ - } - switch(*mode) - { - case 'r': - access = GENERIC_READ; - create = OPEN_EXISTING; - if (*++mode == '+') - { - access |= GENERIC_WRITE; - create = OPEN_ALWAYS; - mode++; - } - break; - - case 'w': - access = GENERIC_WRITE; - create = TRUNCATE_EXISTING; - if (*++mode == '+') - { - access |= GENERIC_READ; - mode++; - } - break; - - case 'a': - access = GENERIC_WRITE; - create = OPEN_ALWAYS; - if (*++mode == '+') - { - access |= GENERIC_READ; - mode++; - } - break; - } - if (*mode == 'b') - { - mode++; - } - else if (*mode == 't') - { - mode++; - } - if (*mode || create == -1) - { - SETERRNO(EINVAL,LIB$_INVARG); - return NULL; - } - h = CreateFile(path,access,share,NULL,create,attr,NULL); - if (h == INVALID_HANDLE_VALUE) - { - if (create == TRUNCATE_EXISTING) - h = CreateFile(path,access,share,NULL,(create = OPEN_ALWAYS),attr,NULL); - } - } - else - { - /* fd open */ - h = INVALID_HANDLE_VALUE; - if (inRANGE(fd, 0, max_open_fd)) - { - PerlIOWin32 *s = fdtable[fd]; - if (s) - { - s->refcnt++; - if (!f) - f = PerlIO_allocate(aTHX); - *f = &s->base; - return f; - } - } - if (*mode == 'I') - { - mode++; - switch(fd) - { - case 0: - h = GetStdHandle(STD_INPUT_HANDLE); - break; - case 1: - h = GetStdHandle(STD_OUTPUT_HANDLE); - break; - case 2: - h = GetStdHandle(STD_ERROR_HANDLE); - break; - } - } - } - if (h != INVALID_HANDLE_VALUE) - fd = win32_open_osfhandle((intptr_t) h, PerlIOUnix_oflags(tmode)); - if (fd >= 0) - { - PerlIOWin32 *s; - if (!f) - f = PerlIO_allocate(aTHX); - s = PerlIOSelf(PerlIO_push(aTHX_ f,self,tmode,PerlIOArg),PerlIOWin32); - s->h = h; - s->fd = fd; - s->refcnt = 1; - if (fd >= 0) - { - fdtable[fd] = s; - if (fd > max_open_fd) - max_open_fd = fd; - } - return f; - } - if (f) - { - /* FIXME: pop layers ??? */ - } - return NULL; -} - -SSize_t -PerlIOWin32_read(pTHX_ PerlIO *f, void *vbuf, Size_t count) -{ - PerlIOWin32 *s = PerlIOSelf(f,PerlIOWin32); - DWORD len; - if (!(PerlIOBase(f)->flags & PERLIO_F_CANREAD)) - return 0; - if (ReadFile(s->h,vbuf,count,&len,NULL)) - { - return len; - } - else - { - if (GetLastError() != NO_ERROR) - { - PerlIOBase(f)->flags |= PERLIO_F_ERROR; - PerlIO_save_errno(f); - return -1; - } - else - { - if (count != 0) - PerlIOBase(f)->flags |= PERLIO_F_EOF; - return 0; - } - } -} - -SSize_t -PerlIOWin32_write(pTHX_ PerlIO *f, const void *vbuf, Size_t count) -{ - PerlIOWin32 *s = PerlIOSelf(f,PerlIOWin32); - DWORD len; - if (WriteFile(s->h,vbuf,count,&len,NULL)) - { - return len; - } - else - { - PerlIOBase(f)->flags |= PERLIO_F_ERROR; - PerlIO_save_errno(f); - return -1; - } -} - -IV -PerlIOWin32_seek(pTHX_ PerlIO *f, Off_t offset, int whence) -{ - static const DWORD where[3] = { FILE_BEGIN, FILE_CURRENT, FILE_END }; - PerlIOWin32 *s = PerlIOSelf(f,PerlIOWin32); -#if Off_t_size >= 8 - DWORD high = (DWORD)(offset >> 32); -#else - DWORD high = 0; -#endif - DWORD low = (DWORD) offset; - DWORD res = SetFilePointer(s->h,(LONG)low,(LONG *)&high,where[whence]); - if (res != 0xFFFFFFFF || GetLastError() != NO_ERROR) - { - return 0; - } - else - { - return -1; - } -} - -Off_t -PerlIOWin32_tell(pTHX_ PerlIO *f) -{ - PerlIOWin32 *s = PerlIOSelf(f,PerlIOWin32); - DWORD high = 0; - DWORD res = SetFilePointer(s->h,0,(LONG *)&high,FILE_CURRENT); - if (res != 0xFFFFFFFF || GetLastError() != NO_ERROR) - { -#if Off_t_size >= 8 - return ((Off_t) high << 32) | res; -#else - return res; -#endif - } - return (Off_t) -1; -} - -IV -PerlIOWin32_close(pTHX_ PerlIO *f) -{ - PerlIOWin32 *s = PerlIOSelf(f,PerlIOWin32); - if (s->refcnt == 1) - { - IV code = 0; -#if 0 - /* This does not do pipes etc. correctly */ - if (!CloseHandle(s->h)) - { - s->h = INVALID_HANDLE_VALUE; - return -1; - } -#else - PerlIOBase(f)->flags &= ~PERLIO_F_OPEN; - return win32_close(s->fd); -#endif - } - return 0; -} - -PerlIO * -PerlIOWin32_dup(pTHX_ PerlIO *f, PerlIO *o, CLONE_PARAMS *params, int flags) -{ - PerlIOWin32 *os = PerlIOSelf(f,PerlIOWin32); - HANDLE proc = GetCurrentProcess(); - HANDLE new_h; - if (DuplicateHandle(proc, os->h, proc, &new_h, 0, FALSE, DUPLICATE_SAME_ACCESS)) - { - char mode[8]; - int fd = win32_open_osfhandle((intptr_t) new_h, PerlIOUnix_oflags(PerlIO_modestr(o,mode))); - if (fd >= 0) - { - f = PerlIOBase_dup(aTHX_ f, o, params, flags); - if (f) - { - PerlIOWin32 *fs = PerlIOSelf(f,PerlIOWin32); - fs->h = new_h; - fs->fd = fd; - fs->refcnt = 1; - fdtable[fd] = fs; - if (fd > max_open_fd) - max_open_fd = fd; - } - else - { - win32_close(fd); - } - } - else - { - CloseHandle(new_h); - } - } - return f; -} - -PERLIO_FUNCS_DECL(PerlIO_win32) = { - sizeof(PerlIO_funcs), - "win32", - sizeof(PerlIOWin32), - PERLIO_K_RAW, - PerlIOWin32_pushed, - PerlIOWin32_popped, - PerlIOWin32_open, - PerlIOBase_binmode, - NULL, /* getarg */ - PerlIOWin32_fileno, - PerlIOWin32_dup, - PerlIOWin32_read, - PerlIOBase_unread, - PerlIOWin32_write, - PerlIOWin32_seek, - PerlIOWin32_tell, - PerlIOWin32_close, - PerlIOBase_noop_ok, /* flush */ - PerlIOBase_noop_fail, /* fill */ - PerlIOBase_eof, - PerlIOBase_error, - PerlIOBase_clearerr, - PerlIOBase_setlinebuf, - NULL, /* get_base */ - NULL, /* get_bufsiz */ - NULL, /* get_ptr */ - NULL, /* get_cnt */ - NULL, /* set_ptrcnt */ -}; - -#endif -