Skip to content

Commit

Permalink
locale.c: Replace an assumption by a cpp check
Browse files Browse the repository at this point in the history
This commit adds a preprocessor directive to check if we are running on
a POSIX 2008 system, rather than just assume we are if the earlier
possibilities weren't the case.  And it causes a compile time error if
none pan out.
  • Loading branch information
khwilliamson committed May 6, 2023
1 parent df4c836 commit 28647f5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion locale.c
Expand Up @@ -907,7 +907,7 @@ S_less_dicey_bool_setlocale_r(pTHX_ const int cat, const char * locale)
# define bool_setlocale_i(i, locale) \
bool_setlocale_r(categories[i], locale)
# define bool_setlocale_c(cat, locale) bool_setlocale_r(cat, locale)
#else
#elif defined(USE_POSIX_2008_LOCALE)

/* Here, there is a completely different API to get thread-safe locales. We
* emulate the setlocale() API with our own function(s). setlocale categories,
Expand Down Expand Up @@ -1590,6 +1590,8 @@ S_emulate_setlocale_i(pTHX_
return new_locale;
}

#else
# error Unexpected Configuration
#endif /* End of the various implementations of the setlocale and
querylocale macros used in the remainder of this program */

Expand Down

0 comments on commit 28647f5

Please sign in to comment.