Skip to content

Commit

Permalink
Merge fa59807 into 2723cea
Browse files Browse the repository at this point in the history
  • Loading branch information
xenu committed Jun 15, 2021
2 parents 2723cea + fa59807 commit bbdd76b
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Porting/Maintainers.pl
Expand Up @@ -1285,6 +1285,10 @@ package Maintainers;
'Win32' => {
'DISTRIBUTION' => "JDB/Win32-0.57.tar.gz",
'FILES' => q[cpan/Win32],
'CUSTOMIZED' => [
'Win32.xs',
'Win32.pm'
]
},

'Win32API::File' => {
Expand Down
2 changes: 1 addition & 1 deletion cpan/Win32/Win32.pm
Expand Up @@ -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;

Expand Down
6 changes: 6 additions & 0 deletions cpan/Win32/Win32.xs
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion dist/Time-HiRes/HiRes.pm
Expand Up @@ -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;

Expand Down
9 changes: 9 additions & 0 deletions dist/Time-HiRes/HiRes.xs
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions t/porting/customized.dat
Expand Up @@ -19,5 +19,7 @@ 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
26 changes: 26 additions & 0 deletions win32/win32.c
Expand Up @@ -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:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion win32/win32sck.c
Expand Up @@ -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();
Expand Down

0 comments on commit bbdd76b

Please sign in to comment.