This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
#133125 revise -DNO_MATHOM logic again in makedef.pl
authorDaniel Dragan <bulk88@hotmail.com>
Fri, 20 Apr 2018 14:46:39 +0000 (10:46 -0400)
committerCraig A. Berry <craigberry@mac.com>
Sat, 21 Apr 2018 13:15:55 +0000 (08:15 -0500)
Revision of patch in #133098.

There is a problem described in #133125 with XS-APITest using with "Perl_"
mathomed C symbols instead of the Perl_-less ones which would get
preprocessor redirected to newer C funcs, then link failure of XS-APITest
on Win32 because missing symbols. These symbols were missing because they
were marked "m" and I thought in commit 1545ba5b04 "m" means no C symbol,
ever, but that isn't true. It seems that "b" means must export on a
with-mathoms default perl. So put back part of the original code before
commit 1545ba5b04 from commit 3f1866a8f6, so that on with mathoms builds
all "b"s are exported, but on no mathom builds, all "b"s are removed/not
exported.

There are some logic holes here for strange or impossible combinations
of flags, like flags "Abi" or just "b" without "A", that I wont address
here.

makedef.pl

index daf6b40..dbd756d 100644 (file)
@@ -736,7 +736,8 @@ unless ($define{'USE_QUADMATH'}) {
     foreach (@$embed) {
        my ($flags, $retval, $func, @args) = @$_;
        next unless $func;
-       if ($flags =~ /[AX]/ && $flags !~ $excludedre)
+       if (($flags =~ /[AX]/ && $flags !~ $excludedre)
+            || (!$define{'NO_MATHOMS'} && $flags =~ /b/))
         {
            # public API, so export