summaryrefslogtreecommitdiff
path: root/win32/perlhost.h
Commit message (Collapse)AuthorAgeFilesLines
* Properly set the phase for END blocks run at the end of a pseudo-forkVincent Pit2014-09-281-1/+3
|
* remove various redundant dTHXesDaniel Dragan2012-11-081-0/+2
| | | | | Remove either unused dTHXes, or remove dTHXes where a nocontext func can be used instead. Smaller/faster machine code is the result.
* remove unused dTHXes in /win32/*Daniel Dragan2012-11-081-10/+0
| | | | | | Remove dTHXes in win32 perl funcs where they were not used, or could be replaced with nocontext croaks/warns. Since Perl_get_context is a function it is not optimized away by the compiler.
* create aTHXa, some unused dTHXs removed in /win32/*Daniel Dragan2012-11-081-1/+1
| | | | | | | | | dTHXes that were unused, or because Newx/Safefree were the only things called were removed. In some places the dTHX turned into dTHXa and aTHXa so the context is not fetched until it is actually used (locality/frees a C stack slot or frees a non-volatile register). Also see http://www.nntp.perl.org/group/perl.perl5.porters/2012/10/msg194414.html and http://www.nntp.perl.org/group/perl.perl5.porters/2012/10/msg194861.html
* "func not implemented" croaks optimizations in /win32/*Daniel Dragan2012-11-081-3/+2
| | | | | | | | | This commit removes a number of "* not implemented" strings from the image. A win32_croak_not_implemented wrapper is created to reduce machine code by not putting the format string on the C stack many times. embed.fnc was used to declare win32_croak_not_implemented for proper cross compiler support of noreturn (noreturn on GCC and VC ok). Tailcalling and noreturn optimizations of the C compiler are heavily used in this commit.
* add PERL_CALLCONV_NO_RET to perlhost.h's PerlProcExit and PerlProc_ExitDaniel Dragan2012-10-171-2/+2
| | | | This gives noreturn to the 2 functions on Visual C Perl.
* Add extern "C" to definitions of four win32_ functionsSteve Hay2012-10-101-5/+4
| | | | | This makes them match their declarations in perlhost.h, which fixes linker errors when linking perl5XX.dll in a C++ build with VC.
* Use GetEnvironmentStringsW(..) instead of GetEnvironmentStringsA(..).Karthik Rajagopalan2012-06-151-4/+4
| | | | | | | | GetEnvironmentStringsA(..) return strings in the OEM code page. This can actually mangle the environment strings if it contain special characters. A better approach would be to get the utf-16 strings through GetEnvironmentStringsW(..) and convert them to ANSI code page. This is now done by win32_getenvironmentstrings(..). To free the block, you can use win32_freeenvironmentstrings(..).
* [perl #101486] Make PL_curstash refcountedFather Chrysostomos2011-10-221-0/+4
| | | | | | | | | | This stops PL_curstash from pointing to a freed-and-reused scalar in cases like ‘package Foo; BEGIN {*Foo:: = *Bar::}’. In such cases, another BEGIN block, or any subroutine definition, would cause a crash. Now it just happily proceeds. newATTRSUB and newXS have been modified not to call mro_method_changed_in in such cases, as it doesn’t make sense.
* The Borland Chainsaw MassacreSteve Hay2011-09-101-16/+0
| | | | | Remove support for the Borland C++ compiler on Win32, as agreed here: http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2011-09/msg00034.html
* In win32_start_child(), remove tmpgv, unused since 0e21945565eb4664.Nicholas Clark2011-07-081-1/+0
|
* Turn $$ into a magical readonly variable that always fetches getpid() ↵Max Maischein2011-05-221-7/+0
| | | | | | | | | | | instead of caching it The intent is that by not caching $$, we eliminate one opportunity for bugs: If one embeds Perl or uses XS and calls fork(3) from C, Perls notion of $$ may go out of sync with what getpid() returns. By always fetching the value of $$ via getpid(), this bug opportunity is eliminated. The overhead of always fetching $$ should be small and is likely only used for tempfile creation, which should be dwarfed by file system accesses.
* Hang on to child handle after signalling SIGTERMJan Dubois2011-03-151-0/+1
| | | | | | | This is a refinement of commit 3aa0ac5aa. We still want to hang on to the mapping between pseudo-process and thread handle, so that we can still waitpid() after signalling SIGTERM. We just don't want to wait implicitly on the signalled process anymore.
* Windows 95 Chainsaw MassacreJan Dubois2010-12-021-10/+0
| | | | | Remove all supporting code for Windows 9x and Windows NT. The minimum supported version is Windows 2000 now.
* Update PerlStdIOGets() signatureJan Dubois2010-04-211-1/+1
| | | | | | Brings it in line with the rest of the PerlStdIO* functions that accept parameters in the same order as the corresponding PerlSIO_* macros. See also commit ecc880cc.
* Fix PerlSIO_fputc() and PerlSIO_fputs() signaturesJan Dubois2010-04-211-2/+2
| | | | | | | | | They should have the same prototype as in stdio. This "proper fix" replaces the 5.12.0 compatible fix in commit 634b482, but cannot be integrated into 5.12.1 because it breaks binary compatibility. See also http://rt.perl.org/rt3/Public/Bug/Display.html?id=72704
* Implement win32_isatty()Jan Dubois2009-12-171-16/+1
| | | | | | | | Commit 827da6a38 added a custom isatty() implementation in win32/perlhost.h, but that code will only be used when perl is compiled with -DPERL_IMPLICIT_SYS. This change makes sure that the custom implementation will be used on Windows for all choices of build options.
* -t should only return TRUE for file handles connected to a TTYJan Dubois2009-12-161-1/+16
| | | | | | | | | The Microsoft C version of isatty() returns TRUE for all character mode devices, including the /dev/null style "nul" device and printers like "lpt1". The included test has only been tested on Windows and Linux; the device names for OS/2 and VMS are just best guesses...
* Throw away uncleanable scopes when exiting a pseudo-forked process.Jan Dubois2009-12-071-2/+7
| | | | | | | | Commit adab9969 tried to clean up those additional scopes, but failed because some of the memory was allocated from a different pool. To avoid triggering the assert() in perl_destruct() this change instead moves the one remaining scope back to the root of the stack, effectively discarding the additional frames without any further processing.
* Cleanup all scopes before exiting a pseudo-forked process.Jan Dubois2009-12-021-0/+5
| | | | | | perl_destruct() contains an assertion that the scope stack is empty. The remaining scopes are due to fork() being called from within a BEGIN block.
* Make win32_start_child responsible for cleaning all the scopes.Gerard Goossen2009-11-121-1/+1
|
* Add mingw64 supportSisyphus2009-11-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hi, Using the attached patch to the blead source (as of a few hours ago), I can build perl with the following OS/compiler/make combos. On 32-bit XP: MSVC++ 7.0 / dmake (uses win32/makefile.mk) MSVC++ 7.0 / nmake (uses win32/Makefile) Borland C++ 5.5.1 / dmake mingw.org's gcc-4.3.0 / dmake mingw.org's gcc-3.4.5 / dmake mingw-w64.sf's 32-bit gcc-4.4.3 / dmake (There's a bug with that last compiler on XP. The perl it builds on XP hangs on XP, but runs ok if copied across to Vista. I think this is unrelated to the patches - probably even unrelated to perl. Without these patches perl will not even build using that last compiler.) On 64-bit Vista: 32-bit MSVC++ 7.0 / nmake (uses win32/Makefile) 32-bit MSVC++ 7.0 / dmake (uses win32/makfile.mk) 32-bit Borland C++ 5.5.1 / dmake mingw.org's 32-bit gcc-4.4.0 / dmake mingw.org's 32-bit gcc-3.4.5 / dmake mingw-w64.sf's 32-bit gcc-4.4.3 / dmake mingw-w64.sf's 64-bit gcc-4.4.3 / dmake mingw-w64.sf's 64-bit x86_64-w64-mingw32-gcc-4.4.3 / dmake 64-bit MicrosoftPlatform SDK for Windows Server 2003 R2 / dmake (uses win32/makefile.mk) 64-bit MicrosoftPlatform SDK for Windows Server 2003 R2 / nmake (uses win32/Makefile) Not all of those builds pass all tests - but where the removal of the patches still permits perl to build, the same tests still fail. That is, *nothing* is lost by including these patches - but there are significant gains. Each of the above builds was done according to the normal win32 configuration parameters - ie multi-threaded, non debug. No unusual config settings were applied. (I did build one debug perl on Vista using mingw-w64.sf's 32-bit gcc-4.4.3 and it built fine.) Please feel free to apply these patches (with or without modification) - and, yes, you're more than welcome to blame me if they cause any breakages ;-) Of course, some of those compilers (Borland, Microsoft, and the compilers from mingw.org) already build perl *without* having to apply any patches. It's just the other compilers that need the patches. The purpose of testing with Borland, Microsoft, and the mingw.org compilers is just to check that these patches don't break them. As a final check, I've done a build on my aging linux (mandrake-9.1) box, gcc-3.2.2. I built with '-des -Duselongdouble -Duse64bitint -Dusedevel'. No problem with that, either. If there's additional testing requirements please let me know, and I'll try to oblige. I believe the patch applied successfully for me - see below my sig for the output. Cheers, Rob Rob@desktop2 ~/GIT/blead $ patch -p0 <blead_diff.diff patching file dist/threads/threads.xs patching file handy.h patching file cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Win32.pm patching file op.c Hunk #1 succeeded at 5774 (offset 47 lines). patching file pp_pack.c patching file util.c Hunk #1 succeeded at 5366 (offset -28 lines). patching file win32/makefile.mk patching file win32/perlhost.h patching file win32/win32.c patching file win32/win32.h patching file README.win32 patching file XSUB.h
* Revert "add CLONEf_KEEP_PTR_TABLE to win fork emulation."David Mitchell2009-08-051-2/+1
| | | | | | This reverts commit 240bfeb992996de28603a7f9e3ee34ecc6e3f286. (its now fixed in a better way in 136e7e597c0d85149921561591710bc54123b221)
* add CLONEf_KEEP_PTR_TABLE to win fork emulation.David Mitchell2009-08-051-1/+2
| | | | | | | | | This keeps the ptr-table table around after the thread has been created. This has been on for user threads for a while now, but not for Windows forks. Turns out that Variable::Magic relies on the table still being there, so crashes under windows forks. This increases memory usage per fork, but stops things crashing. Sigh. [perl #66158]
* win32/perlhost.h: use symbolic constantDavid Mitchell2009-08-051-1/+2
| | | | CLONEf_COPY_STACKS rather than 1
* Add a parameter to win32_get_{priv,site,vendor}lib(), to return the length,Nicholas Clark2009-02-201-9/+11
| | | | | as we already know it, and use it in S_init_perllib() to save a strlen() in S_incpush_use_sep().
* Silence Borland compiler warnings (except for warnings from zlib) here:Steve Hay2008-02-251-3/+3
| | | | | http://www.nntp.perl.org/group/perl.daily-build.reports/2008/02/msg53937.html p4raw-id: //depot/perl@33370
* Eliminate use of Nullop in the core code. Dual life uses remain.Nicholas Clark2008-02-101-2/+2
| | | p4raw-id: //depot/perl@33269
* Nullch and others were still alive and well in some of the operatingSteve Peters2007-12-231-2/+2
| | | | | | system specific directories. I think I've chainsawed all of them now, but I can't guarantee that it compiles anywhere from win32. p4raw-id: //depot/perl@32713
* Change #31426 should also be applied to the PERL_IMPLICIT_SYSSteve Hay2007-06-201-1/+8
| | | | | version of ioctl() p4raw-id: //depot/perl@31428
* [PATCH] Use short pathnames in $^X and @INC if the long form cannot be ↵Jan Dubois2007-01-031-35/+2
| | | | | | | | | | | | | represented in the current codepage Date: Thu, 28 Dec 2006 18:59:40 -0800 Message-ID: <vq09p2p09k6rcu6c9t0mab3vnc335ghg9m@4ax.com> Subject: Re: [PATCH] Use short pathnames in $^X and @INC if the long form cannot be represented in the current codepage From: Jan Dubois <jand@ActiveState.com> Date: Wed, 03 Jan 2007 08:12:35 -0800 Message-ID: <orknp2pj17265modfosjkp2qtt4bdgtgjp@4ax.com> p4raw-id: //depot/perl@29675
* Implement killpg() for MSWin32Jan Dubois2006-12-211-3/+1
| | | | | Message-ID: <m8hjo2pasv3hdbhd1sj9sasen7tm38hrhp@4ax.com> p4raw-id: //depot/perl@29605
* Update cwd() to return the "short" pathname if the long one doesn't fit the ↵Jan Dubois2006-12-201-9/+45
| | | | | | | codepage Message-ID: <3rteo219or8hqr511e4vg1fnsgvgemb4sh@4ax.com> p4raw-id: //depot/perl@29598
* Merge WinCE and Win32 directories -- Initial patchYves Orton2006-04-281-0/+12
| | | | | Message-ID: <9b18b3110604271430k4de84685jec6535ded195ed94@mail.gmail.com> p4raw-id: //depot/perl@28003
* Make Borland and MinGW happy with change 26379Steve Hay2006-01-041-1/+1
| | | | | | (They both complain "invalid conversion from `void*' to `HWND__*'" otherwise) p4raw-id: //depot/perl@26637
* RE: PeekMessage() call in win32\win32.c win32_async_checkJan Dubois2005-12-161-0/+12
| | | | | | | Message-ID: <015901c60207$abd64210$d563a8c0@candy> (Without the proposed alarm.t test) p4raw-id: //depot/perl@26379
* Remove unused USING_WIDE code from win32 and wince branchesJan Dubois2005-11-081-7/+1
| | | | | | From: "Jan Dubois" <jand@ActiveState.com> Message-ID: <078001c5e41e$585c4140$6401a8c0@candy> p4raw-id: //depot/perl@26041
* Make PerlLIOUtime()'s filename constSteve Hay2005-11-011-1/+1
| | | | | | | | | Fixes a warning brought about by change #25941 (which made the filename argument const). The various implementations of PerlLIOUtime() (in NetWare/, win32/ and wince/) already take a const filename. p4raw-link: @25941 on //depot/perl: e96b369dc61077fe31b75895167f55dbce4d7519 p4raw-id: //depot/perl@25945
* Win32 fix for change #25850. I don't know if this define will everSteve Peters2005-10-271-0/+2
| | | | | | be used on Win32, but it does fix the problem at hand. p4raw-link: @25850 on //depot/perl: ca0c25f67f45e5dccb746852d8545d7ae29ed067 p4raw-id: //depot/perl@25859
* Re: $^CHILD_ERROR_NATIVE issues (with attachment)Gisle Aas2005-10-041-1/+1
| | | | | Message-ID: <lrd5ml7i8s.fsf@caliper.activestate.com> p4raw-id: //depot/perl@25688
* Re: janitorial work ? [patch]Jim Cromie2005-07-081-2/+2
| | | | | | | | Message-ID: <42CC3CE9.5050606@divsol.com> (reverted all dual-lived modules since they must work with older perls too so must wait for a new Devel::PPPort) p4raw-id: //depot/perl@25101
* 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
* windows: fix memory leak in %ENV handling (shows up as aGurusamy Sarathy2003-06-091-12/+20
| | | | | | leak even in the simplest fork() loop, because perl_construct() now does the equivalent of %ENV assignments using mg_set()) p4raw-id: //depot/perl@19717
* Use PL_{argv,stdin,stdout}gv to avoid unnecessary gv_fetch calls.Chip Salzenberg2003-02-241-3/+3
| | | p4raw-id: //depot/perl@18763
* windows: support for large filesGurusamy Sarathy2002-12-181-2/+2
| | | | | | | | note that this change will break binary compatibility with the default 5.8.0 build options; nevertheless I think it is worth having in 5.8.1 (people who want the compatibility can disable the option in the makefile) p4raw-id: //depot/perl@18327
* integrate a variant of change#17568 from maint-5.6 branch (theGurusamy Sarathy2002-07-161-23/+0
| | | | | | | do_exec parts elided so that change is restricted strictly to windows; binary compatibility stubs not needed) p4raw-link: @17568 on //depot/maint-5.6/perl: 07691bcd6c6d7fd92f508fd5268e700370ea47c2 p4raw-id: //depot/perl@17570
* make the gettimeofday() implementation in Time::HiRes availableGurusamy Sarathy2002-05-081-1/+8
| | | | | from perl p4raw-id: //depot/perl@16503
* Windows 64-bit support:Gurusamy Sarathy2002-04-211-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | * support for building it in the regular makefiles * large files support via the _*i64() functions (this should be portable to the 32-bit universe too, but quite untested and and binary-incompatible, therefore not enabled there) * three additional test failures in addition to the t/end.t one (see README.win32) * sprintf() on Windows gets %I{32,64,}[xoud] format that parallel the ones available from the CRT (needed because Perl uses the UVxf macros in both sprintf() *and* in sv_catpvf() et al.) * add a few 64-bit notes to README.win32 The following general problems were also fixed: * s/struct stat/Stat_t/g * Data::Dumper had some naughty 'long' typecasts * Errno_pm.PL didn't work safe when winsock.h was not in the same directory as errno.h * various tell/seek things were incorrectly prototyped * squelch ugly looking noise when running tests * Embed.t wasn't linking in all the libraries * perl57.dll is now perl58.dll (anticipating 5.8.0-RC1) * re-enable all the disabled warnings (additional fixes may be needed for the warnings uncovered by this) p4raw-id: //depot/perl@16033
* Win32 signal emulation cleanup.Nick Ing-Simmons2002-01-261-5/+4
| | | p4raw-id: //depot/perlio@14428
* Use PerlMemShared for CopSTASHPV and CopFILE. MUCH harder than it sounds!Nick Ing-Simmons2002-01-141-4/+2
| | | | | | | | | | | | Need to use CopXXXXX macros everywhere and add CopSTASH_free Add new scope type and add support for it to scope.c and scope stack dup-er in sv.c. Add savesharedpv(). Also zealous version of Win32's vmem.h to catch all the abuses. With this t/op/fork.t passes even with zealous checking and checker is point a finger at various threads/shared issues. PL_curcop->cop_io is still an issue. p4raw-id: //depot/perlio@14259