Skip to content

regen/locale.pl: Use 'USE_LOCALE" not 'NO_LOCALE' #23431

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: blead
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions locale_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/

#ifdef LC_CTYPE
# if defined(NO_LOCALE) || defined(NO_LOCALE_CTYPE)
# if ! defined(USE_LOCALE) || defined(NO_LOCALE_CTYPE)

PERL_LOCALE_TABLE_ENTRY(CTYPE, NULL)

Expand All @@ -47,7 +47,7 @@
# define LC_CTYPE_AVAIL_ 0
#endif
#ifdef LC_NUMERIC
# if defined(NO_LOCALE) || defined(NO_LOCALE_NUMERIC)
# if ! defined(USE_LOCALE) || defined(NO_LOCALE_NUMERIC)

PERL_LOCALE_TABLE_ENTRY(NUMERIC, NULL)

Expand All @@ -68,7 +68,7 @@
/* Perl outsources all its collation efforts to the libc strxfrm(), so
* if it isn't available on the system, default "C" locale collation
* gets used */
# if defined(NO_LOCALE) || defined(NO_LOCALE_COLLATE) || ! defined(HAS_STRXFRM)
# if ! defined(USE_LOCALE) || defined(NO_LOCALE_COLLATE) || ! defined(HAS_STRXFRM)

PERL_LOCALE_TABLE_ENTRY(COLLATE, NULL)

Expand All @@ -88,7 +88,7 @@

PERL_LOCALE_TABLE_ENTRY(TIME, NULL)

# if defined(NO_LOCALE) || defined(NO_LOCALE_TIME)
# if ! defined(USE_LOCALE) || defined(NO_LOCALE_TIME)
# define HAS_IGNORED_LOCALE_CATEGORIES_
# define LC_TIME_AVAIL_ 0
# else
Expand All @@ -102,7 +102,7 @@

PERL_LOCALE_TABLE_ENTRY(MESSAGES, NULL)

# if defined(NO_LOCALE) || defined(NO_LOCALE_MESSAGES)
# if ! defined(USE_LOCALE) || defined(NO_LOCALE_MESSAGES)
# define HAS_IGNORED_LOCALE_CATEGORIES_
# define LC_MESSAGES_AVAIL_ 0
# else
Expand All @@ -116,7 +116,7 @@

PERL_LOCALE_TABLE_ENTRY(MONETARY, NULL)

# if defined(NO_LOCALE) || defined(NO_LOCALE_MONETARY)
# if ! defined(USE_LOCALE) || defined(NO_LOCALE_MONETARY)
# define HAS_IGNORED_LOCALE_CATEGORIES_
# define LC_MONETARY_AVAIL_ 0
# else
Expand All @@ -130,7 +130,7 @@

PERL_LOCALE_TABLE_ENTRY(ADDRESS, NULL)

# if defined(NO_LOCALE) || defined(NO_LOCALE_ADDRESS)
# if ! defined(USE_LOCALE) || defined(NO_LOCALE_ADDRESS)
# define HAS_IGNORED_LOCALE_CATEGORIES_
# define LC_ADDRESS_AVAIL_ 0
# else
Expand All @@ -144,7 +144,7 @@

PERL_LOCALE_TABLE_ENTRY(IDENTIFICATION, NULL)

# if defined(NO_LOCALE) || defined(NO_LOCALE_IDENTIFICATION)
# if ! defined(USE_LOCALE) || defined(NO_LOCALE_IDENTIFICATION)
# define HAS_IGNORED_LOCALE_CATEGORIES_
# define LC_IDENTIFICATION_AVAIL_ 0
# else
Expand All @@ -158,7 +158,7 @@

PERL_LOCALE_TABLE_ENTRY(MEASUREMENT, NULL)

# if defined(NO_LOCALE) || defined(NO_LOCALE_MEASUREMENT)
# if ! defined(USE_LOCALE) || defined(NO_LOCALE_MEASUREMENT)
# define HAS_IGNORED_LOCALE_CATEGORIES_
# define LC_MEASUREMENT_AVAIL_ 0
# else
Expand All @@ -172,7 +172,7 @@

PERL_LOCALE_TABLE_ENTRY(PAPER, NULL)

# if defined(NO_LOCALE) || defined(NO_LOCALE_PAPER)
# if ! defined(USE_LOCALE) || defined(NO_LOCALE_PAPER)
# define HAS_IGNORED_LOCALE_CATEGORIES_
# define LC_PAPER_AVAIL_ 0
# else
Expand All @@ -186,7 +186,7 @@

PERL_LOCALE_TABLE_ENTRY(TELEPHONE, NULL)

# if defined(NO_LOCALE) || defined(NO_LOCALE_TELEPHONE)
# if ! defined(USE_LOCALE) || defined(NO_LOCALE_TELEPHONE)
# define HAS_IGNORED_LOCALE_CATEGORIES_
# define LC_TELEPHONE_AVAIL_ 0
# else
Expand All @@ -200,7 +200,7 @@

PERL_LOCALE_TABLE_ENTRY(NAME, NULL)

# if defined(NO_LOCALE) || defined(NO_LOCALE_NAME)
# if ! defined(USE_LOCALE) || defined(NO_LOCALE_NAME)
# define HAS_IGNORED_LOCALE_CATEGORIES_
# define LC_NAME_AVAIL_ 0
# else
Expand All @@ -214,7 +214,7 @@

PERL_LOCALE_TABLE_ENTRY(SYNTAX, NULL)

# if defined(NO_LOCALE) || defined(NO_LOCALE_SYNTAX)
# if ! defined(USE_LOCALE) || defined(NO_LOCALE_SYNTAX)
# define HAS_IGNORED_LOCALE_CATEGORIES_
# define LC_SYNTAX_AVAIL_ 0
# else
Expand All @@ -228,7 +228,7 @@

PERL_LOCALE_TABLE_ENTRY(TOD, NULL)

# if defined(NO_LOCALE) || defined(NO_LOCALE_TOD)
# if ! defined(USE_LOCALE) || defined(NO_LOCALE_TOD)
# define HAS_IGNORED_LOCALE_CATEGORIES_
# define LC_TOD_AVAIL_ 0
# else
Expand Down
3 changes: 3 additions & 0 deletions makedef.pl
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ BEGIN
elsif ($define{HAS_SETLOCALE}) {
$define{USE_LOCALE} = 1;
}
else {
undef $define{USE_LOCALE};
}
}

# https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B#Internal_version_numbering
Expand Down
2 changes: 2 additions & 0 deletions perl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,8 @@ violations are fatal.
# define USE_LOCALE
# elif defined(HAS_SETLOCALE)
# define USE_LOCALE
# else
# undef USE_LOCALE
# endif
#endif

Expand Down
2 changes: 1 addition & 1 deletion regen/locale.pl
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ sub open_print_header {

my $extra = "";
$extra = $extra_conditional{$name} if defined $extra_conditional{$name};
print $l "# if defined(NO_LOCALE) || defined(NO_LOCALE_${name})$extra\n";
print $l "# if ! defined(USE_LOCALE) || defined(NO_LOCALE_${name})$extra\n";

print $l "\n $macro_unless_name\n\n" if $macro_unless_name;
print $l <<~EOF;
Expand Down
Loading