summaryrefslogtreecommitdiff
path: root/ext
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Remove some deprecated functions from mathoms.c"Karl Williamson2018-07-193-5/+19
| | | | | | This reverts commit e6e9f5a198d7e054e6857a9c6e99a07d639f7f3c. I think it best to revert this until I'm ready for stating in perldelta exactly the options for replacing uses of these functions.
* APItest: Add comprehensive UTF-8 validity testsKarl Williamson2018-07-051-0/+269
| | | | | | These test all combinations of bytes at all likely to have any issues. They are run only when an environment variable is set to a particular obscure value, as they take a long time.
* Remove some deprecated functions from mathoms.cKarl Williamson2018-06-283-19/+5
| | | | | These have been deprecated since 5.18, and have security issues, as they can try to read beyond the end of the buffer.
* grok_atoUV: allow non-C strings and documentKarl Williamson2018-06-252-2/+2
| | | | | | | | | | This changes the internal function grok_atoUV() to not require its input to be NUL-terminated. That means the existing calls to it must be changed to set the ending position before calling it, as some did already. This function is recommended to use in a couple of pods, but it wasn't documented in perlintern. This commit does that as well.
* fix Mingw GCC C++ build errors PL_inf/PL_nanDaniel Dragan2018-05-242-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Trying a USE_CPLUSPLUS=define build with dmake (USE_CPLUSPLUS not implemented in GNUMakefile) causes the following error --------- gcc -c -xc++ -I.\include -I. -I.. -DWIN32 -DPERLDLL -DPERL_CORE -s -O2 -fwrapv - fno-strict-aliasing -DPERL_EXTERNAL_GLOB -DPERL_IS_MINIPERL -omini\globals.o .. \globals.c In file included from ..\globals.c:32:0: ..\perl.h:6754:50: error: too many initializers for 'U8 [8] {aka unsigned char [ 8]}' INFNAN_U8_NV_DECL PL_inf = { { LONGDBLINFBYTES } }; ^ ..\perl.h:6790:50: error: too many initializers for 'U8 [8] {aka unsigned char [ 8]}' INFNAN_U8_NV_DECL PL_nan = { { LONGDBLNANBYTES } }; ^ dmake: Error code 129, while making 'mini\globals.o' --------- in plain C mode builds, this error was just a warning and nobody paid attention to it for a while --------- gcc -c -I.\include -I. -I.. -DWIN32 -DPERLDLL -DPERL_CORE -s -O2 -fwrapv -fno-s trict-aliasing -DPERL_EXTERNAL_GLOB -DPERL_IS_MINIPERL -omini\globals.o ..\glob als.c In file included from ..\globals.c:32:0: ..\perl.h:5432:42: warning: excess elements in array initializer #define INFNAN_U8_NV_DECL EXTCONST union { U8 u8[NVSIZE]; NV nv; } ^ ..\perl.h:6754:1: note: in expansion of macro 'INFNAN_U8_NV_DECL' INFNAN_U8_NV_DECL PL_inf = { { LONGDBLINFBYTES } }; ^ ..\perl.h:5432:42: warning: (near initialization for 'PL_inf.u8') #define INFNAN_U8_NV_DECL EXTCONST union { U8 u8[NVSIZE]; NV nv; } ^ ..\perl.h:6754:1: note: in expansion of macro 'INFNAN_U8_NV_DECL' INFNAN_U8_NV_DECL PL_inf = { { LONGDBLINFBYTES } }; ^ ..\perl.h:5432:42: warning: excess elements in array initializer #define INFNAN_U8_NV_DECL EXTCONST union { U8 u8[NVSIZE]; NV nv; } ^ ------------- Now on VC C++ build, LONGDBLINFBYTES is 8 bytes, as defined in LONGDBLINFBYTES macro in config_H.vc, and for VC, "long double" is always typedefed by the CC to "double", so there was no warning, but on GCC, "long double" is the 80 bit/10 byte type and in config_H.gc the 12 byte version of INF is inside LONGDBLINFBYTES macro. Because LONG_DOUBLESIZE define was previously "8" because of makefile logic regardless of CC, # elif NVSIZE == LONG_DOUBLESIZE && defined(LONGDBLINFBYTES) INFNAN_U8_NV_DECL PL_inf = { { LONGDBLINFBYTES } }; was being hit on GCC, even though NVSIZE is 8 as it should be, but LONGDBLINFBYTES was 12. Hence the warning. I didnt research why this warning on GCC didn't cause test failures. Perhaps full perl recomputes the correct initializer in config_sh.PL and doesn't rely on what was in the miniperl initializer for PL_inf. To fix things, always emit the correct value for LONG_DOUBLESIZE and dont hardcode it at 8 for miniperl. 8 must stay for all VCs, and 12/16 is for GCC. Although GNUMakefile doesn't support a USE_CPLUSPLUS build option, it has provisons to support it one day. To keep things in sync, copy miniperl config.h append changes from makefile.mk to GNUMakefile. Also collapse 2 shell cmd lines in "ifeq ($(USE_LONG_DOUBLE),define)" to reduce number of proc launches of cmd.exe by the maketool (perf issue). Next C++ build issue. APItest.xs: In function 'void XS_XS__APItest__Backrefs_Comctl32Version(Perl Interpreter*, CV*)': APItest.xs:6806:37: error: cast from 'LPSTR {aka char*}' to 'WORD {aka shor t unsigned int}' loses precision [-fpermissive] MAKEINTRESOURCE(VS_FILE_INFO)); ^ dmake: Error code 129, while making 'APItest.o' VS_FILE_INFO is internally "RT_VERSION" which is MAKEINTRESOURCE(16). The output type of MAKEINTRESOURCE is a char *. GCC complains about casting that char * back down to a WORD (aka short). Put in a size_t used for pointer arithimitic to silence the error. Another option is to remove the outer MAKEINTRESOURCE in APItest.xs since RT_VERSION has MAKEINTRESOURCE internally, but that assumes implementation details of headers so pick the less dependency on header design option.
* PATCH: [perl #133121] Fix crash in gv_fetchmeth_svSergey Aleynikov2018-04-191-1/+8
| | | | | | S_gv_fetchmeth_internal supports its arguments being either an SV or a (name, len) pair. But when performing an ISA traversal to get method from a parent class, it accounted only for the latter.
* I18N::Langinfo: add a POD linkAaron Crane2018-04-191-1/+2
|
* I18N::Langinfo: reword list itemsAaron Crane2018-04-191-20/+20
|
* I18N::Langinfo: clarify POD with a listAaron Crane2018-04-191-1/+19
|
* I18N::Langinfo: fix POD typoAaron Crane2018-04-191-2/+2
|
* fix SEGV in XS::APItest::Backrefs::Comctl32Version()Daniel Dragan2018-04-172-2/+2
| | | | | | | | really old Mingw GCCs (3.4.5 specifically) dont implement _alloca correctly, switch to a simpler variation a follow on to perl #133084 and see also problems I had with alloca on very old GCCs in https://rt.cpan.org/Public/Bug/Display.html?id=80217
* POSIX.pm: resolve ambiguous #IfDavid Mitchell2018-04-031-2/+3
| | | | | | | | | | | | | In an XS file, # If ... is being interpreted by at least one compiler / build system as a CPP macro rather than as an XS code comment. Indent it to remove ambiguity. http://nntp.perl.org/group/perl.perl5.porters/250229
* PATCH: [perl #133405] POSIX.xs: Silence compiler warningKarl Williamson2018-04-012-2/+2
|
* Mark unused dl_unload_all_files() argumentDagfinn Ilmari Mannsåker2018-03-271-0/+1
|
* Fix building with -Accflags=-DDL_UNLOAD_ALL_AT_EXITDagfinn Ilmari Mannsåker2018-03-271-6/+3
| | | | | | | | | | Commit bb6a367ad5d replaced an XPUSHs inside a loop with an EXTEND outside it, but didn't move the dSP to match. Even if it did, that would have been wrong, since the loop might push more than one value. Revert that bit of the commit. In passing, move the declaration of dl_librefs and dl_libref into the scope where they're used.
* I18N::Langinfo/t/Langinfo.t: Skip tests on early netbsdKarl Williamson2018-03-221-4/+10
| | | | | | | | | | | | | The names of the months and weekdays are swapped with the abbreviated names before netbsd 7, so skip the tests on those platforms. See their commit: revision 1.12.2.1 date: 2013-09-07 20:11:41 +0400; author: bouyer; state: Exp; lines: +38 -38; commitid: HURUJwL5bnZmww4x; Apply patch, requested by joerg in ticket #934: lib/libc/locale/global_locale.c: patch provide consistent and correct data for the C locale.
* op_dump(): display PARENT of top-most nodeDavid Mitchell2018-03-211-0/+1
| | | | | When dumping a subtree, display the op_parent() value for the top-most node of the subtree.
* Update File::Glob to 1.31 to account for changes in 5.27.10Todd Rinaldo2018-03-191-1/+1
| | | | | | | Includes: - C89 changes from Aaron Crane - Unit test timing fixes - Don't use loop: as a label to avoid struct loop confusion
* Silence compilter warningKarl Williamson2018-03-162-2/+2
| | | | | See thread beginning at http://nntp.perl.org/group/perl.perl5.porters/244215
* Don't use duplocale() unless is presentKarl Williamson2018-03-121-1/+2
| | | | | | | | | Prior to this patch, the code assumed that if you have the other, more significant, POSIX 2008 functions available, that duplocale was present and correctly functioning too. However, we found that there have been bugs in it, so that a hints file or Configure probe might want to exclude just it.
* POSIX.pod: Fix nitKarl Williamson2018-03-121-1/+1
|
* Work around Microsoft threaded locale bug for localeconv()Karl Williamson2018-03-123-2/+42
| | | | | | | | | | | | 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!
* Langinfo: Implement CODESET on WindowsKarl Williamson2018-03-121-2/+5
| | | | | | | This applies to I18N::Langinfo, and the API function Perl_langinfo. Windows doesn't have nl_langinfo, so an emulation is used. It turns out that it is easy to emulate the behavior for the CODESET item on Windows, as that vendor has kept things consistent.
* PATCH: [perl #127288] I18N::Langinfo sets UTF-8 bitKarl Williamson2018-03-122-9/+145
| | | | | | | This commit will turn UTF-8 on in the returned SV if its string is legal UTF-8 containing something besides ASCII, and the locale is a UTF-8 one. It is based on the patch included in the ticket, but is generalized to handle edge cases.
* I18N::Langinfo: fix pod nitsKarl Williamson2018-03-121-6/+7
| | | | Removing trailing space; fix typo, clarify
* Actually make I18N::Langinfo avail on all platformsKarl Williamson2018-03-122-16/+76
| | | | | | | | | | | | I thought I had done this earlier, but testing on Windows demonstrated that I hadn't. While at it, move the details in the docs for Perl_langinfo to the module's pod. This doesn't follow the paradigm for putting the Configure stuff in all the related configure files, but I saw no point to doing so. If you are reading this because I was wrong, feel free to ticket it or fix it.
* Change enum names for new locale function parametersKarl Williamson2018-03-121-2/+2
| | | | | | | | | | | | | | Earlier in the 5.27 series, I introduced Perl_langinfo which calls the system nl_langinfo() on platforms that have it, and emulates it otherwise. For each enum parameter 'foo', I made an equivalent parameter PERL_foo. I did this so that no conflicts would arise if any 'foo' were negative. This is less than ideal to have to rename the parameters. In looking further, I realized that perl has always excluded the possibility of negative values for 'foo', so my precaution is unnecessary. And before this new code is released is the time to fix up the interface.
* APItest/t/locale.t: Store hash return for readabilityKarl Williamson2018-03-121-4/+4
|
* APItest/t/locale.t: Sort some testsKarl Williamson2018-03-121-6/+6
| | | | These now appear in the file in their logical order
* File::Glob bsd_glob.c dont use "loop" as a goto labelDaniel Dragan2018-03-071-2/+2
| | | | | | | | | Using loop as a label conflicts with Perl's "struct loop" and "LOOP" types and Visual C 2003 in C++ mode (but not the default C build) doesn't like that. The loop label is from 5.27.1 commit 0db967b2e6 "[perl #131211] fixup File::Glob degenerate matching" bsd_glob.c(995) : error C2226: syntax error : unexpected type 'loop'
* Bump version of POSIX.pm to 1.83; warnings to 1.42Karl Williamson2018-03-021-1/+1
| | | | | These were made using the old version number, and the error was not caught, because of the lateness in getting 5.27.9 tagged
* Remove parameter from isSCRIPT_RUNKarl Williamson2018-03-011-2/+1
| | | | | | Daniel Dragan pointed out that this parameter is unused (the commits that want it didn't get into 5.28), and is causing a table to be duplicated all over the place, so just remove it for now.
* ext/File-Glob/t/rt131211.t: fix timing issuesDavid Mitchell2018-02-271-3/+10
| | | | | | | | | | | | | | | | | | | This test file occasionally fails test numbers 1 and/or 2 on smokes. These two tests measure how long it takes to do a matching and non-matching glob() with a lot of "a*a*a*...." and fail if the match and non-matching times differ too much (the original bug was that non-match went exponential on number of "a*"'s). However, on good systems, the timings returned are typically sub-millisecond, so I'm guessing the occasional failures are due to (small measured noise) * 100 > (another small measured noise). So this commit avoids tests 1&2 failing unless the values measured are large enough not to be merely noise. This is just speculation on my part though - I couldn't reproduce a failure myself.
* APItest/t/locale.t: Add detail to test namesKarl Williamson2018-02-251-4/+5
| | | | This detail can help in interpreting the results.
* APItest:locale.t Fix ALT_DIGITS testKarl Williamson2018-02-221-1/+1
| | | | | | | | | The value returned for ALT_DIGITS may vary by locale and platform. Change the test to only look for a result, as opposed to a particular result. This should fix https://rt.perl.org/Ticket/Display.html?id=132879 but I'll leave the ticket open until that is verified.
* Fix two bugs when calling &xsub when @_ has holesFather Chrysostomos2018-02-181-0/+7
| | | | | | | | | | | | | | | | | | | | This fixes #132729 in the particular instance where an XSUB is called via ampersand syntax when @_ has ‘holes’, or nonexistent ele- ments, as in: @_ = (); $_[1] = 1; &xsub; This means that if the XSUB or something it calls unshifts @_, the first argument passed to the XSUB will now refer to $_[1], not $_[0]; i.e., as of this commit it is correctly shifted over. Previously, a ‘defelem’ was used, which is a magical scalar that remembers its index in the array, independent of whether the array was shifted. In addition, the old code failed to mortalize the defelem, so this commit fixes a memory leak with the new ‘non-elem’ mechanism (a spe- cially-marked element stored in the array itself).
* Add thread-safe locale handlingKarl Williamson2018-02-181-0/+1
| | | | | | This (large) commit allows locales to be used in threaded perls on platforms that support it. This includes recent Windows and Posix 2008 ones.
* Add Perl_setlocale()Karl Williamson2018-02-181-6/+2
| | | | | | | | | | | | | | | | | | khw could not find any modules on CPAN that correctly use the C library function setlocale(). (The very few that do try, do not use it correctly, looking at the return value incorrectly, so they are broken.) This analysis does not include modules that call non-Perl libaries that may call setlocale(). And, a future commit will render the setlocale() function useless in some configurations on some platforms. So this commit adds Perl_setlocale(), for XS code to call, and which is always effective, but it should not be used to alter the locale except on platforms where the predefined variable ${^SAFE_LOCALES} evaluates to 1. This function is also what POSIX::setlocale() calls to do the real work.
* POSIX.xs: Fix localeconv_l()Karl Williamson2018-02-181-1/+2
| | | | | | | Commit 7d5966ae3c3b8f0e43fa09554a46cb8de9c98f5f added use of localeconv_l(). But this commit is buggy in some locales. It needs to find the current locale AFTER any changes have been made due to the LC_NUMERIC locale toggling.
* APItest: Add U8* typemap, and use itKarl Williamson2018-02-162-82/+83
| | | | | This missiing typemap has slowed me down on numerous occasions, as I keep forgetting it's missing
* don't clobber file bytes in :encoding layerZefram2018-02-163-35/+22
| | | | | | | | | | | The PerlIO::encoding layer, when used on input, was creating an SvLEN==0 scalar pointing into the byte buffer, to pass to the ->decode method of the encoding object. Since the method mutates this scalar, for some encodings this led to mutating the byte buffer, and depending on where it came from that might be something visible elsewhere that should not be mutated. Remove the code for the SvLEN==0 scalar, instead always using the alternate code that would copy the bytes into a separate buffer owned by the scalar. Fixes [perl #132833].
* Update link in documentation.James E Keenan2018-02-141-2/+2
| | | | | | Original link was reported dead and replacement link suggested by freethunk. For: RT # 123859
* APItest: Fix C++ compilesKarl Williamson2018-02-091-4/+8
| | | | | | | | | 0a9f8f95112ff40e13406b3e5aab49c01487f045 introduced failures on C++ compilations. This is a better patch, suggested by ilmari. The issue was in cases where the pointer size is 32 bits and the word size was 64, a (STRLEN) -1 returned as an error was getting turned into 0xFFFFFFFF instead of -1.
* APItest: Correct parameter signKarl Williamson2018-02-081-1/+1
| | | | | | Commit ae315a0a3c51e68887704d4907bb6a502a6d4e3f added tests for utf8_to_bytes(). For testing purposes, this parameter should be signed when it comes from perl space.
* Add uvchr_to_utf8_flags_msgs()Karl Williamson2018-02-072-25/+98
| | | | | This is propmpted by Encode's needs. When called with the proper parameter, it returns any warnings instead of displaying them directly.
* APItest:t/utf8_warn_base.pl: Clarify some commentsKarl Williamson2018-02-071-5/+5
|
* APItest:t/utf8_warn_base.pl: Move a variable outside sub()Karl Williamson2018-02-071-11/+12
| | | | | This is in preparation for a future commit which will want to refer to this variable independently.
* APItest:t/utf8_warn_base.pl; Fix 'ok' testsKarl Williamson2018-02-071-3/+3
| | | | | This was putting the condition for the ok in a string, which always succeeds
* APItest: Add tests for utf8_to_bytes()Karl Williamson2018-02-042-0/+86
|
* APItest:t/utf8_setup.pl: Display printables as themselvesKarl Williamson2018-02-041-1/+5
| | | | Instead of the harder to read \xXX