summaryrefslogtreecommitdiff
path: root/vutil.c
Commit message (Collapse)AuthorAgeFilesLines
* Synch cpan/version/* and other files with CPAN version 0.9923.John Peacock2018-04-151-4/+4
| | | | | | Per recommendation of Karl Williamson. Used this program to perform synchronization: https://github.com/jkeenan/scripts-misc/blob/master/sync-version-pm.pl
* Synch cpan/version/* and other files with CPAN version 0.9921.John Peacock2018-04-121-15/+15
| | | | | | | | | Committer's note: In large part probably due to the CUSTOMIZED aspect of 'version' in Porting/Maintainer.pl, the regular 'Porting/sync-with-cpan' program did not give good results when I attempted to use it for version.pm. So I hacked together my own program, available here: https://github.com/jkeenan/scripts-misc/blob/master/sync-version-pm.pl
* Add thread-safe locale handlingKarl Williamson2018-02-181-1/+64
| | | | | | This (large) commit allows locales to be used in threaded perls on platforms that support it. This includes recent Windows and Posix 2008 ones.
* Latch LC_NUMERIC during critical sectionsKarl Williamson2018-02-181-0/+6
| | | | | | | | | | | | | | It is possible for operations on threaded perls which don't 'use locale' to still change the locale. This happens when calling POSIX::localeconv() and I18N::Langinfo(), and in earlier perls, it can happen for other operations when perl has been initialized with the environment causing the various locale categories to not have a uniform locale. This commit causes the areas where the locale for this category should predictably be in one or the other state to be a critical section where another thread can't interrupt and change it. This is a separate mutex, so that only these particular operations will be held up.
* vutil.c: Revise locale version handlingKarl Williamson2018-02-181-37/+34
| | | | | | | | | | | | | This can be called from applications that have changed the locale behind perl's back. Prior to this commit, the code kind of assumed that some things weren't broken, and that it should update perl's records to correspond with the status of things. But this may be an intermediate state, and assuming perl should know about it is assuming too much. We might update perl, and the application restores the state, and control gets transferred back in the wrong state. So simply change the locale to what it needs to be, if necessary, and change back. This change needs to reported upstream to 'version'
* vutil.c: White_space onlyKarl Williamson2018-01-301-16/+16
| | | | | Properly indent a block, and add spaces where C11++ deprecates not having them
* Simplify some LC_NUMERIC macrosKarl Williamson2018-01-301-2/+3
| | | | | | | These macros are marked as subject to change and are not documented externally. I don't know what I was thinking when I named some of them, but whatever no longer makes sense to me. Simplify them, and change so there is only one restore macro to remember.
* Revert "vutil.c: use new SvPVCLEAR and constant string friendly macros"Father Chrysostomos2017-11-011-4/+4
| | | | | | | | This reverts commit 7394beb1401a6ac5e5e19cff7f08486e5141126c. This change to vutil.c is unnecessary and makes it differ needlessly from the CPAN release (CPAN *is* upstream for this file), making syn- chronisation harder.
* Update core with version 0.9918John Peacock2017-06-011-1/+5
|
* vutil.c: use new SvPVCLEAR and constant string friendly macrosYves Orton2016-10-191-4/+4
|
* Update version to 0.9916John Peacock2016-03-191-10/+0
|
* Various fixups for version.pm 0.9914Leon Timmermans2016-03-171-1/+2
|
* Import version.pm 0.9914 from CPANJohn Peacock2016-03-171-107/+93
|
* PATCH: [perl #121930] Bleadperl breaks MDOOTSON/WxKarl Williamson2014-08-111-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The root cause of this issue is that XS code or the libraries it calls is changing the locale behind Perl's back so that the decimal point character is not a dot. Version number parsing relies on it being a dot. This patch fixes the problem by retrieving the current locale just before version number parsing, and updating Perl's records if the locale has changed away from what is expected. Given accurate records, the pre-existing call to the STORE_NUMERIC_LOCAL_SET_STANDARD macro will do what it's supposed to do, and change the locale so that the dot is the radix character for the version number parsing. After the parsing is done, the pre-existing call to the RESTORE_NUMERIC_LOCAL macro will restore properly, but see below This patch should be suitable for both 5.20.1 and 5.21 (though the SHA-1 value in the porting/customize.dat will have to be adjusted because the files aren't otherwise identical). But there is a fundamental difference between the releases. In 5.20.X, Perl does not attempt to keep the radix character a dot at almost all times (though it initializes things so it is a dot, overriding any environmental settings to the contrary). This leads to known non-regression bugs in 5.20 because very little XS code can cope with a non-dot. To fix this, Perl has changed the macros in 5.21 so that the result after the RESTORE_NUMERIC_LOCAL is that the current locale will have a dot. This will fix those long-standing bugs where XS code expecting a dot fails should it be mashed up with modules that change it to something else. But this will break the relatively few modules that want it the other way. So it has been done early in 5.21 to give things a chance to settle down. The extra {} braces around the code that calls the macros is because STORE_NUMERIC_LOCAL_SET_STANDARD declares a variable, and so must be within the declarations area of a block for C89 compilers. (I myself would not write a macro that does this without indicating so in its name.)
* 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
* Allow dynamic lock of LC_NUMERICKarl Williamson2014-06-051-0/+2
| | | | | | | | | | | When processing version strings, the radix character must be a dot even if we otherwise would be using some other character. vutil.c upg_version() changes to the dot, but calls sv_catpvf() which may try to change the character to something else. This commit introduces a way to lock the character to a dot around the call to sv_catpvf() vutil.c is cpan-upstream, but already blead and cpan have diverged, so this just updates the SHA of the new version
* vutil.c, vxs.inc: Avoid warnings from -Wmissing-prototypes -Wundef ↵Brian Fraser2014-02-041-9/+15
| | | | | | | | | | | | -Wunused-label -Wmissing-prototypes was complaining about declaring XS() functions without previously declaring a prototype. -Wundef didn't like using #if foo instead of #ifdef foo -Wunused-label warned because VER_{IV,NM,PV} were defined on all versions of perl, but only used on < 5.17.2
* And now the rest of the sync to 0.9908John Peacock2014-02-041-18/+35
|
* Sync bleadperl to version.pm 0.9908John Peacock2014-02-031-0/+5
| | | | | | | | | | | | | | | | | | | | Attached is a patch to bring blead up to date with the latest CPAN release of version.pm 0.9908. All tests pass (except the expected porting/customized.t). I'm hopeful that this will be the last update for a while. Thanks to Daniel Dragan for his insistent prodding to improve the code. ;-) Thanks John >From c501530aa386a3ccbdb35bcccbccd35d70315651 Mon Sep 17 00:00:00 2001 From: John Peacock <jpeacock@cpan.org> Date: Sun, 2 Feb 2014 11:57:44 -0500 Subject: [PATCH] Update bleadperl to CPAN 0.9908 release Signed-off-by: Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
* Explicit ENTER/LEAVE block for upg_versionJohn Peacock2014-01-181-0/+2
|
* Lots of C optimizations for both speed/correctnessJohn Peacock2014-01-181-38/+62
| | | | | | | | | | | Clean up a lot of the less efficient uses of various Perl macros and functions, mostly from bulk88@hotmail.com. Also deal with the fact that older Perl's were not handling locale setting in a consistent manner. This means going back to the less efficient but always correct method of ALWAYS copying the old locale and switch to C and then restoring, for all Perl releases prior to 5.19.0. Discontinue support for Perl's prior to v5.6.2.
* vutil.c: Use existing macros instead of reinventing themKarl Williamson2014-01-041-13/+2
| | | | | | If there had been documentation referring to these macros, I would have known they existed instead of reinventing them (not as well as the originals).
* Do not crash if passed garbage like array.John Peacock2014-01-041-3/+9
| | | | | Somehow we lost the test that caught getting passed an arrayref instead of a simple scalar. Also integrate fix from perl rt#120872.
* Grab latest changes from CPAN 0.9905John Peacock2014-01-041-1/+5
|
* Integrate CPAN version.pm release into coreJohn Peacock2014-01-041-1/+10
|
* vutil.c: Add preproc code specific to CPANFather Chrysostomos2014-01-041-12/+60
| | | | | | | The purpose is to bring the files into synch so that later version.pm upgrades involve dropping files into place. This requires changing vutil.h a bit to work in the core.
* Extract version routines into two new filesFather Chrysostomos2014-01-041-0/+942
This is to make synchronisation between the CPAN distribution and the perl core easier. The files have different extensions to match what the CPAN distribu- tion will have. vutil.c is a separate compilation unit that the CPAN dist already has. vxs.inc will be included by vxs.xs (vxs.c is obvi- ously alreday taken, being generated from vxs.xs). In the perl core util.c includes vutil.c and universal.c includes vxs.inc.