diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index 25905df689e7..69d4ffe2d3e7 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -1289,6 +1289,10 @@ package Maintainers; 'Win32' => { 'DISTRIBUTION' => "JDB/Win32-0.57.tar.gz", 'FILES' => q[cpan/Win32], + 'CUSTOMIZED' => [ + 'Win32.xs', + 'Win32.pm' + ] }, 'Win32API::File' => { diff --git a/cpan/Win32/Win32.pm b/cpan/Win32/Win32.pm index 1092c5ab521b..52c2be4ccbfd 100644 --- a/cpan/Win32/Win32.pm +++ b/cpan/Win32/Win32.pm @@ -8,7 +8,7 @@ package Win32; require DynaLoader; @ISA = qw|Exporter DynaLoader|; - $VERSION = '0.57'; + $VERSION = '0.57_01'; $XS_VERSION = $VERSION; $VERSION = eval $VERSION; diff --git a/cpan/Win32/Win32.xs b/cpan/Win32/Win32.xs index ca7519f0d60e..d92aaa45cf39 100644 --- a/cpan/Win32/Win32.xs +++ b/cpan/Win32/Win32.xs @@ -98,6 +98,12 @@ typedef LONG (WINAPI *PFNRegGetValueA)(HKEY, LPCSTR, LPCSTR, DWORD, LPDWORD, PVO #ifndef CSIDL_FLAG_CREATE # define CSIDL_FLAG_CREATE 0x8000 #endif +#ifndef SE_PRIVILEGE_REMOVED +# define SE_PRIVILEGE_REMOVED 0x0004 +#endif +#ifndef KEY_WOW64_64KEY +# define KEY_WOW64_64KEY 0x0100 +#endif /* Use explicit struct definition because wSuiteMask and * wProductType are not defined in the VC++ 6.0 headers. diff --git a/dist/Time-HiRes/HiRes.pm b/dist/Time-HiRes/HiRes.pm index 9377c3479fbd..c75f5cd28843 100644 --- a/dist/Time-HiRes/HiRes.pm +++ b/dist/Time-HiRes/HiRes.pm @@ -50,7 +50,7 @@ our @EXPORT_OK = qw (usleep sleep ualarm alarm gettimeofday time tv_interval stat lstat utime ); -our $VERSION = '1.9767'; +our $VERSION = '1.9768'; our $XS_VERSION = $VERSION; $VERSION = eval $VERSION; diff --git a/dist/Time-HiRes/HiRes.xs b/dist/Time-HiRes/HiRes.xs index 1b97962b3a6e..a13f2c27ce3d 100644 --- a/dist/Time-HiRes/HiRes.xs +++ b/dist/Time-HiRes/HiRes.xs @@ -11,6 +11,15 @@ * it under the same terms as Perl itself. */ +#if defined(__MINGW32__) +/* This hides clock_gettime() and friends to avoid conflicts with our own + * implementation. This is especially important in the case of modern versions + * of MinGW.org which define clockid_t as an opaque pointer. + * Both MinGW.org and MinGW-w64 honor this flag. */ +#undef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 1L +#endif + #ifdef __cplusplus extern "C" { #endif diff --git a/t/porting/customized.dat b/t/porting/customized.dat index 1156cd9fa207..c1586ac95cfc 100644 --- a/t/porting/customized.dat +++ b/t/porting/customized.dat @@ -21,6 +21,8 @@ Net::Ping dist/Net-Ping/t/500_ping_icmp.t 3eeb60181c01b85f876bd6658644548fdf2e24 Net::Ping dist/Net-Ping/t/501_ping_icmpv6.t 54373de5858f8fb7e078e4998a4b3b8dbca91783 Pod::Perldoc cpan/Pod-Perldoc/lib/Pod/Perldoc.pm 582be34c077c9ff44d99914724a0cc2140bcd48c Test::Harness cpan/Test-Harness/t/source.t aaa3939591114c0c52ecd44159218336d1f762b9 +Win32 cpan/Win32/Win32.pm fd81bcc98849858c2d0a08f3e96e7f6d10b007dc +Win32 cpan/Win32/Win32.xs 277a5d64dc2ff741e14ebfabfb1b38283f4be531 Win32API::File cpan/Win32API-File/File.pm 8fd212857f821cb26648878b96e57f13bf21b99e Win32API::File cpan/Win32API-File/File.xs beb870fed4490d2faa547b4a8576b8d64d1d27c5 version cpan/version/lib/version.pm 9a4d4c2a89cc95c0c946de6742d6df41e546c12c diff --git a/win32/win32.c b/win32/win32.c index 861e707760fa..7318aeff86c0 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -3161,15 +3161,31 @@ win32_fflush(FILE *pf) DllExport Off_t win32_ftell(FILE *pf) { +#if defined(_MSC_VER) && _MSC_VER < 1500 + /* Visual C++ 2005 does have _ftelli64(), but the compiler in Windows 2003 + * SP1 PSDK doesn't and they both have the same _MSC_VER (1400). */ fpos_t pos; if (fgetpos(pf, &pos)) return -1; return (Off_t)pos; +#elif defined(__MINGW32__) && !defined(_UCRT) && \ + (!defined(__MINGW64_VERSION_MAJOR) || __MINGW64_VERSION_MAJOR < 9) + /* _ftelli64() causes link issues in MinGW.org and it's buggy in MinGW-w64 + * 9.0 and older: + * https://sourceforge.net/p/mingw-w64/mingw-w64/ci/edeeef2aadd9e2f4109dec3f624aafea60cee9bb + */ + return ftello64(pf); +#else + return _ftelli64(pf); +#endif } DllExport int win32_fseek(FILE *pf, Off_t offset,int origin) { +#if defined(_MSC_VER) && _MSC_VER < 1500 + /* Visual C++ 2005 does have _fseeki64(), but the compiler in Windows 2003 + * SP1 PSDK doesn't and they both have the same _MSC_VER (1400). */ fpos_t pos; switch (origin) { case SEEK_CUR: @@ -3189,6 +3205,16 @@ win32_fseek(FILE *pf, Off_t offset,int origin) return -1; } return fsetpos(pf, &offset); +#elif defined(__MINGW32__) && !defined(_UCRT) && \ + (!defined(__MINGW64_VERSION_MAJOR) || __MINGW64_VERSION_MAJOR < 9) + /* _fseeki64() causes link issues in MinGW.org and it's buggy in MinGW-w64 + * 9.0 and older: + * https://sourceforge.net/p/mingw-w64/mingw-w64/ci/edeeef2aadd9e2f4109dec3f624aafea60cee9bb + */ + return fseeko64(pf, offset, origin); +#else + return _fseeki64(pf, offset, origin); +#endif } DllExport int diff --git a/win32/win32sck.c b/win32/win32sck.c index ef5c682101c8..168cd06eb80f 100644 --- a/win32/win32sck.c +++ b/win32/win32sck.c @@ -492,7 +492,7 @@ win32_select(int nfds, Perl_fd_set* rd, Perl_fd_set* wr, Perl_fd_set* ex, const { int r; int i, fd, save_errno = errno; - FD_SET nrd, nwr, nex; + fd_set nrd, nwr, nex; bool just_sleep = TRUE; StartSockets();