This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
makedef.pl: Use all #ifdefs to decide
authorKarl Williamson <khw@cpan.org>
Fri, 16 Feb 2018 22:15:06 +0000 (15:15 -0700)
committerKarl Williamson <khw@cpan.org>
Sun, 18 Feb 2018 18:02:37 +0000 (11:02 -0700)
This uses all the conditions that go in to deciding to define this
variable, instead of taking a shortcut.  (It's unfortunate that the
shortcut defined in perl.h now used elsewhere via commit
7e5377f714ebe84e0fe2599b3bfec50036f0d18f is not available to makedef.pl.
It would make sense to have this file look at perl.h and avoid
duplication).

This fixes some freebsd builds, which failed because their hints file
undef'd a different variable than this shortuct looked at.

makedef.pl
perlvars.h

index 93e47b0..aabdaa7 100644 (file)
@@ -399,7 +399,10 @@ unless ($define{'USE_ITHREADS'}) {
                         );
 }
 
-unless ($define{'HAS_NEWLOCALE'} && ! $define{'NO_POSIX_2008_LOCALE'})
+unless ( $define{'HAS_NEWLOCALE'}
+    &&   $define{'HAS_FREELOCALE'}
+    &&   $define{'HAS_USELOCALE'}
+    && ! $define{'NO_POSIX_2008_LOCALE'})
 {
     ++$skip{$_} foreach qw(
         PL_C_locale_obj
index 472ae2d..708bade 100644 (file)
@@ -104,7 +104,10 @@ PERLVAR(G, locale_mutex, perl_mutex)   /* Mutex for setlocale() changing */
 #endif
 
 /* Proxy for HAS_POSIX_2008_LOCALE, since that is not defined in time for this */
-#if defined(HAS_NEWLOCALE) && ! defined(NO_POSIX_2008_LOCALE)
+#if   defined(HAS_NEWLOCALE)                    \
+ &&   defined(HAS_FREELOCALE)                   \
+ &&   defined(HAS_USELOCALE)                    \
+ && ! defined(NO_POSIX_2008_LOCALE)
 PERLVAR(G, C_locale_obj, locale_t)
 #endif