| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
POSIX 2008 added an independent set of locale handling functions beyond
the venerable setlocale. This commit changes so they can be used rather
than have no locale handling if there is, say, a problem with setlocale.
|
| |
|
|
|
|
| |
This will be used in future commits
|
|
|
|
|
|
|
|
|
| |
This fixes compiler warnings "performing pointer arithmetic on a null
pointer has undefined behavior"
There are several ways to fix this. This one was suggested by
Tomasz Konojacki++. Instead of trying to point to address 1 and 2, two
variables are created, and we point to them. const is cast away.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are only three valid numbers in Computer Science: 0, 1, and "as
many as you like". 256 is not therefore a valid number, and its use
should be commented, or better, a mnemonic used instead.
These uses were spotted by lgtm as being unnecessary, and some people
were confused as to their purpose. This commit changes the 256, to in
one case, a sizeof() that indicates its a guard against going outside
the array bounds of that data structure. And in the 2nd case, it
verifies that it fits inside the space allotted to a function parameter.
A comment helps clarify that.
|
|
|
|
|
|
|
| |
These thread-safe functions are not normally used on unthreaded builds,
retaining the use of the library functions that have long been used.
But, it is now possible to tell Configure to use them on unthreaded
builds.
|
| |
|
|
|
|
| |
This is defensive coding progress, to avoid dereferencing a NULL ptr.
|
|
|
|
|
|
|
| |
This struct has two names. I previously left the less descriptive one
as the primary because of back compat issues. But I now realize that
regcomp.h is only used in the core, so it's ok to swap for the better
name to be primary.
|
|
|
|
|
|
| |
which evaluates to SSize_t in the unlikely event that there isn't a
ptrdiff_t on the platform. ptrdiff_t is safer than ssize_t, as the
latter need not contain any negative number besides -1.
|
|
|
|
|
|
|
|
|
|
|
|
| |
With -Dquadmath C++ builds, the calls to log10() and ldexp() would
cause ambiguous overloaded function errors, since all of log10(float),
log10(double) and log10(long double) were canidates for a
log10(__float128) call. Similarly for ldexp().
signbit() had a different problem, two of the tests in ext/POSIX/t/math.t
failed with the default signbit() macro, presumably because the
__float128 was being converted to a long double, since the macro in
math.h didn't special case for __float128.
|
|
|
|
|
|
|
| |
There are bugs in strtold().
James Keenan fixed a file permissions problem originally introduced by
this commit, but the fix has been squashed into it.
|
|
|
|
| |
The former is designed to be compilable out.
|
|
|
|
|
|
|
| |
They are defined in the Perl library but referenced in the Perl
executable, but the Perl executable can't see them unless they
are exported by the library, and some linkers only make a symbol
a public export if they've been told to explicitly.
|
| |
|
|
|
|
|
| |
This replaces a complicated trie with a dfa. This should cut down the
number of conditionals encountered in parsing many code points.
|
| |
|
|
|
|
| |
This will allow it to be used inline.
|
|
|
|
|
| |
Several problems with this compile option were not caught before 5.28
was frozen.
|
|
|
|
|
|
| |
Arguments used within macros need to be parenthesized in case they are
called with an expression. This commit changes
_CHECK_AND_OUTPUT_WIDE_LOCALE_UTF8_MSG() to do that.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is like my_atof2(), but with an extra argument signifying the
length of the input string to parse. If that length is 0, it uses
strlen() to determine it.
Then my_atof2() just calls my_atof3() with a zero final parameter.
And this commit just uses the bulk of the current my_atof2() as the core
of my_atof3(). Changes were needed however, because it relied on
NUL-termination in a number of places.
This allows one to convert a string that isn't necessarily
NUL-terminated to an NV.
|
|
|
|
|
|
| |
Dodge the "offsetof has a builtin meaning; use /Zc:offsetof- to revert to
old, non-conforming definition" error when compiling Socket.xs by reverting
to an old definition of STRUCT_OFFSET for that compiler.
|
|
|
|
|
|
|
|
|
|
|
| |
RT #132955
Commit 0879cd66ef3f00 fixed perl to still build under C++ after changes
to PL_inf and PL_nan. Unfortunately this seems to have broken C++ builds
under Windows.
Handle the extern 'C' stuff in a different way - as suggested by Leon T -
that hopefully satisfies all platforms.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Various symbols get exported (or not) by makedef.pl. The determination
of some of the new ones is fairly complex in perl.h, and unfortunately
in general the code logic to do so must be copied into makedef.pl (until
a volunteer fixes this). I thought I could avoid a bunch of this by
using the symbol ${^SAFE_LOCALES} which in fact was created so that
programs wouldn't have to know about this complexity.
The problem is that on Windows, miniperl is always compiled
single-thread and so locales are always safe, and so makedef.pl (which
is called by miniperl) got the wrong information. The solution,
unfortunately, is to reproduce the complexity in makedef.pl
Spotted by Daniel Dragan.
|
|
|
|
|
|
|
|
|
|
|
| |
In recent Perl versions, the underlying locale for LC_NUMERIC has been
kept in C because XS code is expecting a dot radix character. But if
the LC_NUMERIC locale has a dot, that is unnecessary. (There is also
the thousands grouping separator which for safety we verify is empty.)
Thus 5.27 doesn't always keep the underlying locale in C; it does so
only if necessary.
This commit updates various comments and pods to reflect this change.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Prior to Visual Studio 2015, the localeconv() function only looks at the
global locale, not the per-thread one it should. This works around this
by creating critical sections, switching to the global locale to call
localeconv(), then switching back. For the most common usage, it avoids
the switch by parsing a string it generates that should contain the
desired substring. This leaves the switch required for retrieving the
floating point grouping separator and the currency string, plus
POSIX::localeconv(). The first two could be avoided by extra code as
detailed in the pod for switch_to_global_locale(); patches welcome!
|
|
|
|
| |
There should be no other differences
|
|
|
|
|
| |
These put the defines dealing with locale critical sections in one
place, more logically set out.
|
|
|
|
| |
These had gotten out of sync
|
|
|
|
|
|
| |
PL_C_locale_obj is now only created on threaded builds on systems with
POSIX 2008. On unthreaded builds, we really should continue to use the
old tried and true library calls.
|
|
|
|
|
|
|
|
|
| |
For clarity, this places these locale definitions that depend solely on
having locales or not earlier, and by themselves, so don't get mixed up
with the definitions that have more complicated provenances.
In moving them, I also changed white space to accepted indentations,
and vertical alignment.
|
|
|
|
|
| |
These macros are core-only, so should generate a compiler error if used
outside of core, instead of compiling as no-ops.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently they tell the toker that the next thing will be attributes,
followed by an XBLOCK or XTERMBLOCK respectively.
This commit subtly changes their meanings so that they indicate that
attributes legally *might* follow. This makes the code which initially
sets them slightly simpler (no need to check whether the next char is
':'), and the code elsewhere in yylex() which handles XATTR* only triggers
if the next char is ':' anyway.
Doing it this way will shortly make detection simpler of an attribute
illegally following a signature.
|
|
|
|
|
|
| |
Commit b2f82b52000c3bfe6e6df200c775e2a639d91552 failed to document
details about the clang warnings. This commit adds a link to clang's
documentation
|
|
|
|
|
| |
Clang thread-safety analysis fails to correctly work in this situation
(and is documented as failing), so turn off that warning here.
|
| |
|
|
|
|
|
|
| |
This (large) commit allows locales to be used in threaded perls on
platforms that support it. This includes recent Windows and Posix 2008
ones.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
which is a NOOP except on DEBUGGING builds
|
|
|
|
|
|
| |
These are used so that they appear ahead of #include intrpvar.h, so
they can be used by that file. This enables this commit to simplify
some #ifdefs
|
|
|
|
| |
These no longer make sense; were for core internal use only
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
This undocumented macro is unused in the core, and all these are
commented that they are subject to change. And it confuses things, so
just remove it.
|
|
|
|
|
|
|
|
|
|
| |
The LC_NUMERIC locale category is kept so that generally the decimal
point (radix) is a dot. For some (mostly) output purposes, it needs to
be swapped into the program's current underlying locale so that a
non-dot can be printed.
This commit changes things so that if the current underlying locale uses
a decimal point, the swap doesn't happen, as it's not needed.
|