Skip to content

Commit

Permalink
locale.c: Move #define to proper location
Browse files Browse the repository at this point in the history
This symbol dealing with LC_TIME was instead defined with LC_MONETARY.
Move it and add a compilation-time error check that the corresponding
MONETARY symbol and it don't conflict.  (In the old location it was
obvious to the reader that they didn't conflict, but here it is
somewhat less obvious.)
  • Loading branch information
khwilliamson committed Oct 30, 2023
1 parent fe048cf commit 8a16188
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion locale.c
Original file line number Diff line number Diff line change
Expand Up @@ -6332,7 +6332,6 @@ S_my_langinfo_i(pTHX_

# if defined(USE_LOCALE_MONETARY) && defined(HAS_LOCALECONV)
# define LANGINFO_RECURSED_MONETARY 0x1
# define LANGINFO_RECURSED_TIME 0x2

/* Can't use this method unless localeconv() is available, as that's
* the way we find out the currency symbol.
Expand All @@ -6357,6 +6356,12 @@ S_my_langinfo_i(pTHX_

# endif
# ifdef USE_LOCALE_TIME
# define LANGINFO_RECURSED_TIME 0x2
# ifdef LANGINFO_RECURSED_MONETARY
# if LANGINFO_RECURSED_MONETARY == LANGINFO_RECURSED_TIME
# error LANGINFO_RECURSED_MONETARY must differ from LANGINFO_RECURSED_TIME
# endif
# endif

/* If we have ruled out being UTF-8, no point in checking further. */
if ( is_utf8 != UTF8NESS_NO
Expand Down

0 comments on commit 8a16188

Please sign in to comment.