summaryrefslogtreecommitdiff
path: root/win32/include
Commit message (Collapse)AuthorAgeFilesLines
* Fix Win32 build with MinGW/gcc-4.8+ which define some errno.h values >= 100Steve Hay2013-10-171-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Commit ea95436966 made changes to how errno.h constants are handled for VC++ 2010 and above, which have added new values in the range 100-140. Some versions of gcc-4.8.0 and above are now catching up and provide some of these new values too (e.g. binaries from http://mingw-w64.sourceforge.net/ but not currently those from http://www.mingw.org/), but they don't provide all of them. EADDRINUSE is provided, so convert_errno_to_wsa_error() gets included, but the compilation fails because the following #defines which VC++ 2010 and above provide are missing: EBADMSG EIDRM ENODATA ENOLINK ENOMSG ENOSR ENOSTR ENOTRECOVERABLE EOTHER ETIME ETXTBSY Simply ignore (#ifdef away) these constants for those compilers that don't provide them.
* Fix the #include of winsock2.h in win32/include/sys/errno2.hSteve Hay2013-09-161-3/+12
| | | | | | | | | | | | | | | | | | | | | | | For some reason (I didn't figure out why) cpan/Win32/Win32.xs did not compile as of the previous commit, but in any case we cannot just blindly include winsock2.h because (a) it is too late if winsock.h has already been included and (b) early WinCE doesn't have it. The definition of _WINSOCKAPI_ was also wrongly not updated to _WINSOCK2API_ but was mistaken in its comment "Don't drag in everything" anyway: it's actually just an old-fashioned "include guard", not a means to include a minimal API from the file. (The mistaken comment came from the original ext/Errno/Errno_pm.PL before this round of $!-related changes. That file also had a redundant "#include <winsock.h>" left in it which should have been removed along with earlier work that removed the other one, so tidy that up too.) Steal a hopefully more correct incantation from win32/include/sys/socket.h instead. Now that we allow for the possibility of winsock.h being used again, we must take care not to make use of WSAECANCELLED if it is not defined. (That is the only WSAExxx constant which we use that was new in winsock2.h.)
* We need winsock2.h for WSAECANCELLED in errno2.hSteve Hay2013-09-161-1/+1
|
* Clarify a comment in errno2.hSteve Hay2013-09-161-1/+2
|
* Fix Windows build for compilers other than VC10+Steve Hay2013-09-161-0/+9
| | | | | | | The new errno2.h only ensures that those new Exxx constants which are required by convert_wsa_error_to_errno() have definitions; the other new Exxx constants will remain undefined on compilers other than VC10+, so we must take care not to use them unless we know they are defined.
* Simplify errno2.h slightlySteve Hay2013-09-161-88/+78
| | | | | | | | | | | | | | | | | | | | | There is no need for it to worry about ensuring that standard errno.h values like EINTR are defined. There is no point in it defining dummy constants like EINVALIDPROCTABLE which do not exist in errno.h at all. They would only be given the corresponding WSAExxx values anyway, so the win32sck.c function might just as well return them directly. Other constants like ESOCKTNOSUPPORT which do not exist in errno.h on Windows but presumably exist elsewhere since POSIX tries to exports them are still worth defining (where possible -- it isn't possible for EHOSTDOWN since there is no corresponding WSAEHOSTDOWN); add comments for these for clarity. Also comment which errno.h constants are new in VC10, and mention three of the four that win32/include/sys/socket.h used to redefine because they are used in the perl core (ENOTSOCK, EAFNOSUPPORT and ECONNABORTED) -- the other one (ECONNRESET) does not appear to be used in the perl core as far as I can tell.
* Fix stringification of $! in VC10+ builds where errno > sys_nerrSteve Hay2013-09-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | VC++ 2010 and above define a "POSIX supplement" of errno values ranging from EADDRINUSE (100) to EWOULDBLOCK (140), but sys_nerr is still 43 and strerror() returns "Unknown error" for them. We already avoid using strerror() if errno > sys_nerr, but we treat such values as Windows error codes (i.e. <winerror.h> values) and look up the corresponding system messages for them. There is no better plan for these POSIX supplement errno values, but they must be converted from <errno.h> values to <winerror.h> values first otherwise we will look up the wrong system message. In practice, we only expect to find errno > sys_nerr in the case of Windows sockets errors (we used to assign WSAGetLastError() to errno), so we simply convert Exxx values to WSAExxx values where possible, and use a default <winerror.h> value otherwise (namely, ERROR_INVALID_FUNCTION). This change fixes code such as this: perl -le "$!=107; print $!" which now outputs the expected "No connection could be made because the target machine actively refused it." rather than "The program stopped because an alternate diskette was not inserted." (in VC10+ builds). Also: Fix the spelling of ECANCELED.
* Fix a problem with mod_perl on Windows using VS2010+.Steve Hay2013-09-162-13/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem is caused by the following two commits, which sought to deal with new Exxx values (with values >= 100) in errno.h which Microsoft added in VS2010: http://perl5.git.perl.org/perl.git/commit/b59e75b34cef3fedd214c9b6ee744146cf8b3308 http://perl5.git.perl.org/perl.git/commit/912c63ed00375338703043928cac3c740d00cc9d The former commit was mostly a patch to Errno and POSIX, together with some other cleaning up in win32/win32.h and win32/include/sys/socket.h; the latter commit was a fixup to win32/include/sys/socket.h which restored (more aggressively) the ENOTSOCK->WSAENOTSOCK redefinition and added similar redefinitions for ECONNABORTED, ECONNRESET and EAFNOSUPPORT. It is the latter commit which causes this little program to output ECONNABORTED=10053 rather than ECONNABORTED=106 as it ought to do in VC10 (and higher) builds of perl: #include <windows.h> #include "EXTERN.h" #include "perl.h" #include "XSUB.h" void main(void) { printf("ECONNABORTED=%d\n", ECONNABORTED); } That change is now causing problems with mod_perl, in which the (Perl level) APR::Status::is_ECONNABORTED() and the (C level) APR_STATUS_IS_ECONNABORTED() which it calls are failing to recognize an aborted connection (indicated by error code ECONNABORTED set by Apache httpd.exe). The APR_STATUS_IS_ECONNABORTED() macro is picked up by mod_perl from APR's apr_errno.h: #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \ || (s) == APR_OS_START_SYSERR + WSAECONNABORTED) where #ifdef ECONNABORTED #define APR_ECONNABORTED ECONNABORTED #else #define APR_ECONNABORTED (APR_OS_START_CANONERR + 18) #endif When this is compiled into httpd.exe ECONNABORTED is 106 (from errno.h) and APR_STATUS_IS_ECONNABORTED(s) amounts to #define APR_STATUS_IS_ECONNABORTED(s) ((s) == 106 || (s) == 730053) but when compiled into APR/Status.dll ECONNABORTED is 10053 (redefined to WSAECONNABORTED as above) so APR_STATUS_IS_ECONNABORTED(s) then amounts to #define APR_STATUS_IS_ECONNABORTED(s) ((s) == 10053 || (s) == 730053) which doesn't pick up an error code of 106 coming from httpd.exe. This could be worked around in mod_perl by redefining ECONNABORTED and the other three back to their original errno.h values to match what httpd.exe is using, but that might just cause problems in the other direction, with those values no longer matching the values which perl.exe is using. Moreoever, this problem could affect other XS interfaces (not just mod_perl), so it really needs to be fixed in perl. This commit implements the alternative solution mentioned the commit message for the first commit cited above. (As noted in that previous commit message, this solution equally has potential problems, missing out on the advantages of the original solution implemented, namely, better backwards compatibility with other perl code having hard-coded numeric error codes, but this will be unavoidable if we want to get to a sane state.) Note that changing the $! values is an incompatible change, so should probably not be done for 5.18.x. That's unfortunate for mod_perl (and anything else similarly affected), but that will just have to either live with the breakage (which was introduced in 5.14.0) until 5.20.0 or else try the workaround mentioned above for 5.14.x, 5.16.x and 5.18.x. The main change is to use a new function throughout win32/win32sck.c to convert WSAGetLastError() values into errno.h constants before assigning to errno. Every possible WSAExxx value (as documented by MSDN) is mapped to an Exxx value, although it is still possible for other WSAxxx values to get assigned to errno unchanged (but that has always been the case, and any non-existent Exxx values get mapped back to WSAExxx values anyway...). We must then ensure that all of those Exxx values are defined, which is now done (in the new file, win32/include/sys/errno2.h) in a friendlier manner, being careful not to redefine any (specifically the new ones in VC++ 2010 and above) which already exist. The rest are defined as the WSAExxx values, as mentioned above. Finally, we need the Errno module to know about these values, which is done by having it include that same new header file to ensure that it gets the same definitions, rather than having to play its own games. The new header is also used in POSIX, which similarly wants definitions of as many as possible of its hard-coded list of Exxx values.
* Remove option to build without USE_SOCKETS_AS_HANDLES on WindowsSteve Hay2012-09-281-14/+0
| | | | | | | | | The option is always defined by default and can't be disabled from the makefiles. Manually disabling it causes several tests to fail, which nobody has reported, so we presume nobody does this. The non-default configuration is believed to be historical cruft with no value now, and has clearly bitrotted in recent years (hence the test failures), so remove it to simplify the codebase slightly.
* Fix Win32 build with plain VC6 compilerSteve Hay2011-11-201-0/+101
| | | | | | | | | | | | | The Socket extension module currently doesn't compile on Win32 using the VC6 compiler with its standard headers. It can be made to work by using the 2003 Platform SDK, but it is preferable not to need to do that. This patch is by Jan Dubois, taken from http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2011-11/msg00557.html The patch is modified slightly to take account of MinGW already providing the missing struct definition, but may yet need some further tweaks since it was not quite finished by Jan yet.
* Fixup errno definitions for WindowsJan Dubois2011-03-191-0/+12
| | | | | | | | | Redefine all winsock based Exxxx error constants used in the core: For VS2010 we don't want to use the errno.h values, and for older compiler versions we don't have a definition anyways. Also remove the warnings about VS2010 from README.win32, as they should all be resolved now.
* Redefine errno values for Visual Studio 2010Steve Hay2011-03-191-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Perl traditionally stores WinSock error codes (values above 10000) in errno, with corresponding support for $! to stringify them properly. In Visual Studio 2010 (and presumably newer Windows SDKs) Microsoft has started to define additional errno constants in errno.h (values between 100 and 200) with conflicting names (e.g. EWOULDBLOCK). There are 2 ways to deal with this situation: 1) Redefine the errno.h constants back to the winsock values for the Errno and POSIX modules. 2) Translate the winsock error codes to the new errno constants in the socket implementation in win32/win32sck.c. Solution 1) has the advantage that any existing Perl code that has numeric error codes hard-coded in it will continue to work. Solution 2) has the advantage that XS code using external libaries can set errno to the new constants, and they will be handled consistently in the Perl core. It will however need additional support for other compilers and runtime libraries that don't support these new error codes. This commit implements solution 1). Blame attribution: the commit message is from Jan Dubois, the actual patch was created by Steve Hay. Signed-off-by: Jan Dubois <jand@activestate.com>
* Define our own sockaddr_in6 for VC6Jan Dubois2010-12-141-0/+45
| | | | | | | | The version defined by the VC6 headers is missing the sin6_scope_id field, used by Socket.xs. Ideally VC6 should be used with later versions of the header files from a Windows Platform SDK, but this patch at least keeps it compilable with plain VC6. I have not verified that the IPv6 code will actually works with this configuration.
* Include ws2tcpip.h to get IPv6 definitionsJan Dubois2010-11-251-7/+15
| | | | | | | | This commit also moves down the 'extern "C"' wrapper so that it doesn't apply to any #included headers because they may generate C++ code (templates) which doesn't confirm to "C" linkage (when this header is included in C++ mode, e.g. while compiling win32/perllib.c).
* Support Visual C++ 2010Steve Hay2010-11-181-1/+3
| | | | | Also add a couple of things to win32/makefile.mk which were only previously applied to win32/Makefile
* Re: Merge WinCE into Win32 directory and remove the the WinCE directoryYves Orton2006-05-021-37/+5
| | | | | | | | Message-ID: <9b18b3110605011002m56c0db99n169ae677efb6d059@mail.gmail.com> Plus adjustements to MANIFEST. Also, perlmain.c seemed to be missing from the patch. p4raw-id: //depot/perl@28061
* Merge WinCE and Win32 directories -- Initial patchYves Orton2006-04-281-0/+38
| | | | | Message-ID: <9b18b3110604271430k4de84685jec6535ded195ed94@mail.gmail.com> p4raw-id: //depot/perl@28003
* RE: [perl #37708] [PATCH] wrong IP_ constants on Win32 Jan Dubois2005-11-221-1/+5
| | | | | | From: "Jan Dubois" <jand@ActiveState.com> Message-ID: <062401c5ef26$99b3a490$2217a8c0@candy> p4raw-id: //depot/perl@26189
* Make opendir() filename const in Win32-land & friendsSteve Hay2005-06-241-1/+1
| | | | | | | | That fact that it wasn't const already was highlighted by a warning from pp_open_dir() generated by change 24743. Rather than undo the const change in pp_open_dir(), this seems to make more sense. Hope I haven't broken Netware or WinCE. p4raw-id: //depot/perl@24974
* from the non-ANSI comment police (was: it won't compile on win32) H.Merijn Brand2001-12-292-11/+11
| | | | | | | Message-Id: <20011229203646.24CF.H.M.BRAND@hccnet.nl> (NetWare tree not touched because it's very //) p4raw-id: //depot/perl@13939
* 4-arg select() was busted on windows because change#8178 didn'tGurusamy Sarathy2001-08-051-0/+2
| | | | | | | make it into mainline p4raw-link: @8178 on //depot/maint-5.6/perl: 961154a63c3a7b345be8bfbe688f4d089c92e684 p4raw-id: //depot/perl@11589
* get sources building on windows+MSVC again (untested with otherGurusamy Sarathy2000-11-231-36/+1
| | | | | compilers) p4raw-id: //depot/perl@7827
* various little goofs in change#4385Gurusamy Sarathy1999-10-151-1/+1
| | | | | p4raw-link: @4385 on //depot/perl: 95136addeff6f7c87c13a96a62f5eaafb9bafdcf p4raw-id: //depot/perl@4386
* win32_*dir() cleanup; win32_readdir() iterates as necessaryGurusamy Sarathy1999-10-151-20/+23
| | | | | rather than win32_opendir() reading all files up front (untested) p4raw-id: //depot/perl@4385
* yet more cleanups of the PERL_OBJECT, MULTIPLICITY and USE_THREADSGurusamy Sarathy1999-07-122-3/+2
| | | | | | | | | | | | | | | | builds; passing the implicit context is unified among the three flavors; PERL_IMPLICIT_CONTEXT is auto-enabled under all three flavors (see the top of perl.h) for testing; all varargs functions foo() have a va_list-taking variant vfoo() for generating the context-free versions; the PERL_OBJECT build should now be hyper-compatible with CPAN extensions (C++ is totally out of the picture) result has only been tested on Windows TODO: write docs on the THX rationale and idiomatic usage of the Perl API p4raw-id: //depot/perl@3667
* Mingw32 + w32api-0.1.5 tweaksNick Ing-Simmons1999-05-151-2/+2
| | | | | - now more like other Win32 compilers p4raw-id: //depot/perl@3425
* export opendir() set of functions on win32Gurusamy Sarathy1998-07-021-6/+6
| | | p4raw-id: //depot/perl@1273
* [asperl] added AS patch#2Gurusamy Sarathy1998-01-301-0/+2
| | | p4raw-id: //depot/asperl@443
* Add files and tweak others to get 'native' Mingw32 gcc port asNick Ing-Simmons1997-11-271-0/+10
| | | | | | | | | | far as building miniperl and perl.dll (but not import lib yet) Seems to lack popen()/pclose() and fcloseall() and fflushall(). Also only CRTDLL not MCRTDLL so threading is probably not possible yet. Had to mess with win32iop.h's placement as we need __attribute__ to get STDCALL, and #define of printf messes up proto.h p4raw-id: //depot/ansiperl@325
* [Win32] Export our own FD_SET() et al to complete sockets-as-handles pretense.Gurusamy Sarathy1997-11-181-1/+53
| | | p4raw-id: //depot/win32/perl@261
* Add missing win32_closesocket() and export it (extension writers' complaint).Gurusamy Sarathy1997-11-121-0/+1
| | | p4raw-id: //depot/win32/perl@239
* [differences between cumulative patch application and perl5.004_01]perl-5.004_01Tim Bunce1997-06-111-4/+7
| | | | | | | | | [editor's note: The changes between this and 5.004 were processed from the m1t2 release, which was a bad idea as it was the _01 release which had the final corrected attributions. The differences between the various m*t* releases do that; I considered it most valuable just to look at the _NN releases. Many patches have been separated out and/or applied from the p5p archives nonetheless.]
* [inseparable changes from match from perl-5.003_99 to perl-5.003_99a]Perl 5 Porters1997-05-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BUILD PROCESS Subject: AFS patches From: Chip Salzenberg <chip@perl.com> Files: Configure installperl CORE LANGUAGE CHANGES Subject: SECURITY: Forbid glob() when tainting (-T or setuid) From: Chip Salzenberg <chip@perl.com> Files: pod/perlrun.pod pod/perlsec.pod pp_sys.c Subject: SECURITY: Forbid exec() if $ENV{TERM} or $ENV{ENV} is tainted From: Chip Salzenberg <chip@perl.com> Files: pod/perlrun.pod pod/perlsec.pod t/op/taint.t taint.c CORE PORTABILITY Subject: (NeXT|Open)Step update Date: Wed, 7 May 97 17:47:02 -0500 From: Gerd Knops <gerti@BITart.com> Files: Configure MANIFEST config_h.SH hints/next_3.sh hints/next_4.sh private-msgid: 9705072247.AA18882@BITart.com Subject: Win32 update (consolidated patch plus three followups) From: Gurusamy Sarathy <gsar@engin.umich.edu> Files: EXTERN.h README.win32 lib/Sys/Hostname.pm pod/perldelta.pod win32/config.H win32/config.w32 win32/config_sh.PL win32/perllib.c win32/win32.c win32/win32.h win32/include/sys/socket.h DOCUMENTATION Subject: Updates to perldelta From: Chip Salzenberg <chip@perl.com> Files: pod/perldelta.pod Subject: Document 'Possible attempt to separate words with commas' Date: 06 May 1997 23:27:55 +0200 From: Gisle Aas <gisle@aas.no> Files: pod/perlop.pod Msg-ID: hyb9snvdw.fsf@bergen.sn.no (applied based on p5p patch as commit 18270fd3b8aafde2f9ea21ea13adde95ef24b149) Subject: Document that C<m?x?> is just like C<?x?> From: Chip Salzenberg <chip@perl.com> Files: pod/perlop.pod OTHER CORE CHANGES Subject: Fix for redefined sort subs nastiness Date: Thu, 08 May 1997 20:04:18 -0400 From: Gurusamy Sarathy <gsar@engin.umich.edu> Files: op.c pod/perldelta.pod pod/perldiag.pod sv.c t/op/sort.t Msg-ID: 199705090004.UAA15032@aatma.engin.umich.edu (applied based on p5p patch as commit e9e069932a0db06904b29e2b09a435afd40ed35c)
* [inseparable changes from patch from perl5.003_23 to perl5.003_24]perl-5.003_24Perl 5 Porters1997-01-294-0/+211
CORE LANGUAGE CHANGES Subject: glob defaults to $_ Date: Mon, 27 Jan 1997 03:09:13 -0500 From: Gurusamy Sarathy <gsar@engin.umich.edu> Files: op.c opcode.pl pod/perlfunc.pod t/op/glob.t private-msgid: <199701270809.DAA00934@aatma.engin.umich.edu> Subject: Re: an overloading bug Date: Sun, 26 Jan 1997 19:07:45 -0500 From: Gurusamy Sarathy <gsar@engin.umich.edu> Files: pod/perldiag.pod pod/perlfunc.pod pp_ctl.c private-msgid: <199701270007.TAA26525@aatma.engin.umich.edu> CORE PORTABILITY Subject: Win32 port From: Gary Ng <71564.1743@compuserve.com> Files: MANIFEST win32/* Subject: Amiga files Date: Sun, 26 Jan 1997 17:42:15 +0100 From: Norbert Pueschel <pueschel@imsdd.meb.uni-bonn.de> Files: MANIFEST README.amiga hints/amigaos.sh private-msgid: <77724712@Armageddon.meb.uni-bonn.de> DOCUMENTATION Subject: perldelta Fcntl enhancement Date: Sat, 25 Jan 1997 17:05:34 +0200 (EET) From: Jarkko Hietaniemi <jhi@cc.hut.fi> Files: pod/perldelta.pod private-msgid: <199701251505.RAA22159@alpha.hut.fi> Subject: Updates to perldelta re: Fcntl, DB_File, Net::Ping From: Paul Marquess <pmarquess@bfsec.bt.co.uk> Files: pod/perldelta.pod Subject: Document restrictions on gv_fetchmethod() and perl_call_sv() From: Chip Salzenberg <chip@atlantic.net> Files: pod/perldelta.pod pod/perlguts.pod Subject: perldiag.pod: No comma allowed after %s Date: Sat, 25 Jan 1997 17:41:53 +0200 (EET) From: Jarkko Hietaniemi <Jarkko.Hietaniemi@cc.hut.fi> Files: pod/perldiag.pod private-msgid: <199701251541.RAA04120@alpha.hut.fi> Subject: perlfunc.pod: localtime Date: Sat, 25 Jan 1997 18:29:37 +0200 (EET) From: Jarkko Hietaniemi <jhi@cc.hut.fi> Files: pod/perlfunc.pod private-msgid: <199701251629.SAA08114@alpha.hut.fi> Subject: perlfunc diff: gmtime Date: Tue, 28 Jan 1997 14:52:08 +0000 From: Peter Haworth <pmh@edison.ioppublishing.com> Files: pod/perlfunc.pod private-msgid: <32EE1298.7B90@edison.ioppublishing.com> Subject: Updates to guts Date: Sun, 26 Jan 1997 19:34:18 -0500 (EST) From: Ilya Zakharevich <ilya@math.ohio-state.edu> Files: pod/perlguts.pod private-msgid: <199701270034.TAA13177@monk.mps.ohio-state.edu> TESTS Subject: New test op/closure.t From: Tom Phoenix <rootbeer@teleport.com> Files: MANIFEST t/op/closure.t