summaryrefslogtreecommitdiff
path: root/util.h
Commit message (Collapse)AuthorAgeFilesLines
* The VC6 Chainsaw MassacreSteve Hay2019-10-171-3/+2
| | | | | Remove MS Visual C++ 6.0 support as agreed in the thread starting here: https://www.nntp.perl.org/group/perl.perl5.porters/2019/07/msg255625.html
* Document instr()Karl Williamson2019-09-021-0/+10
|
* (perl #134221) support O_APPEND for open ..., undef on VMSTony Cook2019-07-161-0/+11
| | | | | | | | | | VMS doesn't allow you to delete an open file like POSIXish systems do, but you can mark a file to be deleted once it's closed, but only when you open it. Since VMS doesn't (yet) have mkostemp() we can add our own flag to our mkostemp() emulation to pass the necessary magic to open() call to delete the file on close.
* embed.fnc: Add flag for bypass macro existenceKarl Williamson2019-05-301-0/+2
| | | | | | | Sometimes a function is reduced to be a wrapper, and we want for code to directly call the underlying one, but we retain the old 'Perl_foo' function to avoid breaking code that used that form. I've tried various kludges around that, but this seems more promising.
* use Perl_my_mkstemp() where appropriateZefram2017-12-221-0/+5
| | | | | | Since commit e48855bdd2fc57fc51156f5e4b8dee6b544456c8 there has been no need to be conditional about using mkstemp(). Perl_my_mkstemp() is always available, one way or another.
* portable Perl_my_mkostemp()Zefram2017-12-221-0/+3
| | | | | | | | Akin to the existing Perl_my_mkstemp(), Perl_my_mkostemp() is defined as a macro for mkostemp() where available, and otherwise as our own implementation of it. The guts of our own implementations of the two functions are shared. Perl_my_mkostemp() is not guaranteed to handle O_CLOEXEC: that depends on open() handling it.
* util.h: simplify cpp conditionalsAaron Crane2017-10-211-15/+9
|
* Parenthesize macro arguments to ninstr()Karl Williamson2017-09-141-1/+2
| | | | | | | This did not work properly if called if expressions for arguments. Could someone write a porting test to look for non-parenthesized macro arguments involved in expressions
* (perl #127663) add our own mkstemp() implementationTony Cook2017-09-111-0/+4
| | | | | | | | | | | | Needed to generate temp files for safer in-place editing. Not based on any particular implementation, the BSD implementations tend to be wrappers around a megafunction that also does a few variations of mkstemp() and mkdtemp(), which we don't need (yet.) This might also be useful as a replacement for broken mkstemp() implementations that use a mode of 0666 when creating the file, though we'd need to add Configure probing for that.
* (perl #127663) create a separate random source for internal useTony Cook2017-09-111-0/+6
| | | | | and use it to initialize hash randomization and to innoculate against quadratic behaviour in pp_sort
* add PERL_UTIL_H_ to util.h, not util.hDavid Mitchell2017-04-181-0/+6
| | | | | | | With v5.25.11-59-g7335cb8 I added an include guard. PERL_UTIL_H_, but added it to util.c rather than util.h. I am not a smart man....
* Use memmem() if available on the platform for Perl_ninstr()Karl Williamson2016-05-121-0/+5
|
* Reinstate "Make instr() a macro"Karl Williamson2016-05-091-0/+2
| | | | | | This reverts commit 2e08dfb2b133af0fbcb4346f8d096ca68454ca54, thus reinstating the commit it reverted. This was delayed until 5.25. The next commit will solve some problems with c++ that this commit causes
* Revert "Make instr() a macro"Karl Williamson2016-04-081-2/+0
| | | | | | This reverts commit fea1d2dd5d210564d442a09fe034b62f262f35f9 due to it causing problems so close to the release of 5.24. See https://rt.perl.org/Ticket/Display.html?id=127852
* Make instr() a macroKarl Williamson2016-03-171-0/+2
| | | | ... thus avoiding a function call overhead
* perlapi: Add some S<>Karl Williamson2015-09-031-2/+2
| | | | | so that these constructs appear on a single output line for reader convenience.
* Replace common Emacs file-local variables with dir-localsDagfinn Ilmari Mannsåker2015-03-221-6/+0
| | | | | | | | | | | | | | | | An empty cpan/.dir-locals.el stops Emacs using the core defaults for code imported from CPAN. Committer's work: To keep t/porting/cmp_version.t and t/porting/utils.t happy, $VERSION needed to be incremented in many files, including throughout dist/PathTools. perldelta entry for module updates. Add two Emacs control files to MANIFEST; re-sort MANIFEST. For: RT #124119.
* add filename handling to xs handshakeDaniel Dragan2014-11-131-10/+18
| | | | | | | | | | | | | | | | | | | | | - this improves the error message on ABI incompatibility, per [perl #123136] - reduce the number of gv_fetchfile calls in newXS over registering many XSUBs - "v" was not stripped from PERL_API_VERSION_STRING since string "vX.XX.X\0", a typical version number is 8 bytes long, and aligned to 4/8 by most compilers in an image. A double digit maint release is extremely unlikely. - newXS_deffile saves on machine code in bootstrap functions by not passing arg filename - move newXS to where the rest of the newXS*()s live - move the "no address" panic closer to the start to get it out of the way sooner flow wise (it nothing to do with var gv or cv) - move CvANON_on to not check var name twice - change die message to use %p, more efficient on 32 ptr/64 IV platforms see ML post "about commit "util.c: fix comiler warnings"" - vars cv/xs_spp (stack pointer pointer)/xs_interp exist for inspection by a C debugger in an unoptimized build
* add xs_handshake APIDaniel Dragan2014-11-071-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This API elevates the amount of ABI compatibility protection between XS modules and the interp. It also makes each boot XSUB smaller in machine code by removing function calls and factoring out code into the new Perl_xs_handshake and Perl_xs_epilog functions. sv.c : - revise padlist duping code to reduce code bloat/asserts on DEBUGGING ext/DynaLoader/dlutils.c : - disable version checking so interp startup is faster, ABI mismatches are impossible because DynaLoader is never available as a shared library ext/XS-APItest/XSUB-redefined-macros.xs : - "" means dont check the version, so switch to " " to make the test in xsub_h.t pass, see ML thread "XS_APIVERSION_BOOTCHECK and XS_VERSION is CPP defined but "", mow what?" ext/re/re.xs : - disable API version checking until #123007 is resolved ParseXS/Utilities.pm : 109-standard_XS_defs.t : - remove context from S_croak_xs_usage similar to core commit cb077ed296 . CvGV doesn't need a context until 5.21.4 and commit ae77754ae2 and by then core's croak_xs_uage API has been long available and this backport doesn't need to account for newer perls - fix test where lack of having PERL_IMPLICIT_CONTEXT caused it to fail
* C backtrace tweaks.Jarkko Hietaniemi2014-06-111-0/+6
| | | | | | | | | Rename the environment variable that triggers the backtrace before warns and croaks as PERL_USE_C_BACKTRACE_ON_ERROR (and correspondingly, the define as USE_C_BACKTRACE_ON_ERROR). Pod cleanups and updates, and move the needed #includes from perl.h to util.c since that's the only place where they are needed.
* Add C backtrace API.Jarkko Hietaniemi2014-06-071-0/+72
| | | | | | | | Useful for at least debugging. Supported in Linux and OS X (possibly to some extent in *BSD). See perlhacktips for details.
* perlapi: Refactor placements, headings of some functionsKarl Williamson2014-06-051-0/+2
| | | | | | | | | | | | | | It is not very user friendly to list functions as "Functions found in file FOO". Better is to group them by purpose, as many were already. I went through and placed the ones that weren't already so grouped into groups. Patches welcome if you have a better classification. I changed the headings of some so that the important disctinction was the first word so that they are placed in the file more appropriately. And a couple of ones that I had created myself, I came up with a name that I think is better than the original
* Add a USING_MSVC6 macro to identify Microsoft Visual C++ 6.0Steve Hay2013-09-191-3/+1
| | | | | | | This simplifies some of the logic necessary for coping with its various problems. Suggested by Nicholas Clark.
* Update the comment in util.h related to HAS_QUAD and U64TYPE.Nicholas Clark2013-09-181-1/+3
|
* Fix the VC6 build on Windows following commit 3be8f09452Steve Hay2013-09-131-2/+5
| | | | | | The VC6 compiler has slightly flaky support for __int64 and chokes on util.c when using the 64-bit implementation of drand48, so switch it to the 32-bit version instead.
* [perl #115928] a consistent (public) rand() implementationTony Cook2013-09-131-0/+27
| | | | | | | | | | | | | | | | Based on Yves's random branch work. This version makes the new random number visible to external modules, for example, List::Util's XS shuffle() implementation. I've also added a 64-bit implementation when HAS_QUAD is true, this should be significantly faster, even on 32-bit CPUs. This is intended to produce exactly the same sequence as the original implementation. The original version of this commit retained the "freebsd" name from Yves's original work for the function and data structure names. I've removed "freebsd" from most function names so the name isn't an issue if we choose to replace the implementation,
* Change core calls of isALNUM() to isWORDCHAR()Karl Williamson2012-12-311-1/+1
| | | | The latter is more clearly named to indicate it includes the underscore.
* Remove the EPOC port.Nicholas Clark2012-11-191-2/+2
| | | | | | | EPOC was a family of operating systems developed by Psion for mobile devices. It was the predecessor of Symbian. The port was last updated in April 2002.
* update the editor hints for spaces, not tabsRicardo Signes2012-05-291-2/+2
| | | | | This updates the editor hints in our files for Emacs and vim to request that tabs be inserted as spaces.
* Change name of ibcmp to foldEQKarl Williamson2010-06-051-0/+15
| | | | | | | | | | | | | | | | As discussed on p5p, ibcmp has different semantics from other cmp functions in that it is a binary instead of ternary function. It is less confusing then to have a name that implies true/false. There are three functions affected: ibcmp, ibcmp_locale and ibcmp_utf8. ibcmp is actually equivalent to foldNE, but for the same reason that things like 'unless' and 'until' are cautioned against, I changed the functions to foldEQ, so that the existing names, like ibcmp_utf8 are defined as macros as being the complement of foldEQ. This patch also changes the one file where turning ibcmp into a macro causes problems. It changes it to use the new name. It also documents for the first time ibcmp, ibcmp_locale and their new names.
* Remove all #ifdef MACOS_TRADITIONAL code in core and non-dual-life XS code.Nicholas Clark2009-04-271-5/+1
| | | | | | | | (MacOS support was removed from MakeMaker in 6.22, and merged to blead on 15th December 2004 with 5dca256ec738057dc331fb644a93eca44ad5fa14. After this point MacOS wouldn't even have been able to build the perl binary, because it would not have been able to build DynaLoader. If anyone wishes to resurrect MacOS, start by reversing this commit and the relevant part of that commit.)
* Add editor blocks to some header files.Marcus Holland-Moritz2008-01-011-0/+10
| | | p4raw-id: //depot/perl@32793
* Fix up copyright years for files modified in 2007.Nicholas Clark2007-11-071-2/+2
| | | p4raw-id: //depot/perl@32237
* Update copyright years in .h files. Also, in .plRafael Garcia-Suarez2007-01-051-1/+1
| | | | | | files that generate .h files, so they'll be ready next time. p4raw-id: //depot/perl@29695
* missed some SYMBIAN ifdefsJarkko Hietaniemi2005-10-181-1/+1
| | | | | Message-ID: <B356D8F434D20B40A8CEDAEC305A1F24E7A64D@esebe105.NOE.Nokia.com> p4raw-id: //depot/perl@25790
* Symbian port of PerlJarkko Hietaniemi2005-04-211-2/+2
| | | | | Message-ID: <B356D8F434D20B40A8CEDAEC305A1F2453D653@esebe105.NOE.Nokia.com> p4raw-id: //depot/perl@24271
* Re: [perl #30633] Perl's "do" operator with a variety of absolute paths ↵Yitzchak Scott-Thoennes2004-11-031-1/+1
| | | | | | | under Cygwin Message-ID: <20041103012429.GA7196@efn.org> p4raw-id: //depot/perl@23468
* Fix up Larry's copyright statements to my best knowledge.Jarkko Hietaniemi2003-04-161-1/+2
| | | | | | | (Lots of Perl 5 source code archaeology was involved.) Larry didn't make strangled noises when I showed him the patch, either :-) p4raw-id: //depot/perl@19242
* Reverse copyright update (#18801) for files not changed in 2003.Hugo van der Sanden2003-03-021-1/+1
| | | p4raw-id: //depot/perl@18807
* Update all copyrights to 2003, from JarkkoHugo van der Sanden2003-03-021-1/+1
| | | p4raw-id: //depot/perl@18801
* integrate change#18320 from maint-5.6 branchGurusamy Sarathy2002-12-171-3/+2
| | | | | | | | | | | | | | C<require '\foo\bar.pm'> fails on windows if not running from the root directory; for a test case, see: http://bugs.activestate.com/show_bug.cgi?id=19317 this was due to not recognizing \foo\bar.pm as an absolute path name p4raw-link: @18320 on //depot/maint-5.6/perl: b900fc1f8c2531fe3108ef7a9cc5b4590a5dc7f6 p4raw-id: //depot/perl@18321 p4raw-integrated: from //depot/maint-5.6/perl@18319 'merge in' util.h (@9288..)
* Copyright++. (Not all the toplevel *.h have one, it seems.)Jarkko Hietaniemi2002-01-231-1/+1
| | | p4raw-id: //depot/perl@14391
* NetWare port from Guruprasad S <SGURUPRASAD@novell.com>.Jarkko Hietaniemi2001-06-161-0/+7
| | | p4raw-id: //depot/perl@10643
* buncha MacPerl patches for bleadperlChris Nandor2001-02-131-1/+1
| | | | | Message-Id: <p05010404b6ae6f85e07a@[10.0.1.177]> p4raw-id: //depot/perl@8792
* Bump up Larry's copyright.Jarkko Hietaniemi2001-01-011-1/+1
| | | p4raw-id: //depot/perl@8289
* Epoc updateOlaf Flebbe2000-10-031-2/+2
| | | | | Message-ID: <26423.969484586@www10.gmx.net> p4raw-id: //depot/perl@7124
* MacOS support, part 1 (from Matthias NeeracherGurusamy Sarathy2000-05-281-1/+5
| | | | | <neeri@iis.ee.ethz.ch>) p4raw-id: //depot/perl@6143
* set SvUTF8 on vectors only if there are chars > 127; update copyrightGurusamy Sarathy2000-02-061-1/+1
| | | | | years (from Gisle Aas) p4raw-id: //depot/perl@5009
* another change towards a shareable optree: avoid pointer to filegvGurusamy Sarathy1999-11-111-0/+24
| | | | | | | | | in COP; revert parts of change#4485 and s/xcv_filegv/xcv_file/ (CvFILE() may yet come in handy somewhere); adjust compiler doodads to suit p4raw-link: @4485 on //depot/perl: b195d4879f55e1610299cb9b1b55356940c2a577 p4raw-id: //depot/perl@4545
* [inseparable changes from match from perl-5.003_91 to perl-5.003_92]Perl 5 Porters1997-03-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CORE LANGUAGE CHANGES Subject: Strictly follow lexical context of C<eval ''> and nested subs From: Chip Salzenberg <chip@perl.com> Files: op.c Subject: Make ::SUPER and UNIVERSAL work together From: Chip Salzenberg <chip@perl.com> Files: gv.c pod/perlguts.pod CORE PORTABILITY Subject: OS/2 patches Date: Wed, 5 Mar 1997 22:08:43 -0500 (EST) From: Ilya Zakharevich <ilya@math.ohio-state.edu> Files: hints/os2.sh lib/ExtUtils/MakeMaker.pm t/op/taint.t Msg-ID: 199703060308.WAA22211@monk.mps.ohio-state.edu (applied based on p5p patch as commit eda4d5189d403b15f244b4696a710fb91d15053e) Subject: VMS patches Date: Wed, 05 Mar 1997 23:10:24 -0500 (EST) From: Charles Bailey <bailey@HMIVAX.HUMGEN.UPENN.EDU> Files: lib/ExtUtils/MM_VMS.pm lib/ExtUtils/Manifest.pm perlsdio.h t/op/runlevel.t t/op/taint.t vms/descrip.mms vms/perly_c.vms vms/sockadapt.c vms/sockadapt.h vms/vms_yfix.pl private-msgid: 01IG5SQE4A6U00661G@hmivax.humgen.upenn.edu DOCUMENTATION Subject: Add taint checks and srand to perldelta Date: Sun, 2 Mar 1997 11:56:08 -0800 (PST) From: Tom Phoenix <rootbeer@teleport.com> Files: pod/perldelta.pod Msg-ID: Pine.GSO.3.95q.970302115355.23058D-100000@kelly.teleport.com (applied based on p5p patch as commit b28e0bc0aa3232e18d1bacb3efcbfb755ad100e0) Subject: Don't call FileHandle 'deprecated' From: Chip Salzenberg <chip@perl.com> Files: pod/perldelta.pod Subject: Improve sample module header Date: Sat, 01 Mar 1997 10:32:31 -0700 From: Tom Christiansen <tchrist@jhereg.perl.com> Files: pod/perlmod.pod Msg-ID: 199703011732.KAA14693@jhereg.perl.com (applied based on p5p patch as commit 3e1e15658152387f41e00ded4796cede4e1e10d3) Subject: Update list of CPAN sites Date: Sun, 2 Mar 1997 16:54:22 +0200 (EET) From: Jarkko Hietaniemi <jhi@iki.fi> Files: pod/perlmod.pod Msg-ID: 199703021454.QAA07446@alpha.hut.fi (applied based on p5p patch as commit 9423903e60e6c92c1893f5f4cab2476f403f8a4b) Subject: Enhance description of 'server error' Date: Tue, 4 Feb 1997 21:03:23 +0200 (EET) From: Jarkko Hietaniemi <jhi@cc.hut.fi> Files: pod/perldiag.pod private-msgid: 199702041903.VAA16070@alpha.hut.fi Subject: Regularize format of E-Mail addresses in *.pod From: Chip Salzenberg <chip@perl.com> Files: pod/*.pod LIBRARY AND EXTENSIONS Subject: Use IV instead of double for tms structure members From: Chip Salzenberg <chip@perl.com> Files: ext/POSIX/POSIX.xs OTHER CORE CHANGES Subject: Make sure $^X is tainted when ARG_ZERO_IS_SCRIPT From: Chip Salzenberg <chip@perl.com> Files: toke.c Subject: Clarify '-T too late' error From: Chip Salzenberg <chip@perl.com> Files: perl.c pod/perldiag.pod Subject: Warn when redefining or undefining a constant sub From: Chip Salzenberg <chip@perl.com> Files: pod/perldiag.pod pp.c sv.c Subject: Don't generate spurious 'not imported' warning From: Chip Salzenberg <chip@perl.com> Files: gv.c t/pragma/strict-vars pod/perldiag.pod Subject: Clarify message re: @host in string From: Chip Salzenberg <chip@perl.com> Files: pod/perldiag.pod pod/perltrap.pod toke.c Subject: Disconnect refs that are targets of pp_readline From: Chip Salzenberg <chip@perl.com> Files: pp_hot.c Subject: Fix typo in test of HvFILL() From: Chip Salzenberg <chip@perl.com> Files: op.c Subject: Allow for pad name array to be shorter than pad array From: Chip Salzenberg <chip@perl.com> Files: op.c Subject: Eliminate format-string type warnings Date: Mon, 3 Mar 1997 10:15:11 +0100 (MET) From: Hallvard B Furuseth <h.b.furuseth@usit.uio.no> Files: doio.c ext/POSIX/POSIX.xs gv.c hints/dec_osf.sh pp.c pp_ctl.c pp_hot.c run.c sv.c x2p/a2py.c private-msgid: 199703030915.KAA11634@bombur2.uio.no Subject: Update copyright dates From: Chip Salzenberg <chip@perl.com> Files: *.[hc] x2p/*.[hc] win32/EXTERN.h vms/vmsish.h vms/vms.c TESTS Subject: Smarter t/op/taint.t Date: Mon, 3 Mar 1997 10:31:54 -0800 (PST) From: Tom Phoenix <rootbeer@teleport.com> Files: t/op/taint.t private-msgid: Pine.GSO.3.95q.970303103047.24000A-100000@kelly.teleport.com Subject: Fix taint test for systems without csh From: Chip Salzenberg <chip@perl.com> Files: t/op/taint.t