Skip to content

Commit

Permalink
locale.c: Use typedef to simplify
Browse files Browse the repository at this point in the history
This allows some preprocessor conditionals to be removed
  • Loading branch information
khwilliamson committed May 6, 2021
1 parent e21e822 commit d6bac4d
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions locale.c
Expand Up @@ -2805,12 +2805,14 @@ L<C<POSIX::localeconv()>|POSIX/localeconv>, which is thread-friendly.
*/

#ifndef HAS_SOME_LANGINFO

typedef int nl_item; /* Substitute 'int' for emulated nl_langinfo() */

#endif

const char *
#ifdef HAS_SOME_LANGINFO
Perl_langinfo(const nl_item item)
#else
Perl_langinfo(const int item)
#endif
{
/* If we are not paying attention to the category that controls an item,
* instead return a default value. Also return the default value if there
Expand Down Expand Up @@ -2956,11 +2958,7 @@ Perl_langinfo(const int item)
#ifdef USE_LOCALE

STATIC const char *
# ifdef HAS_SOME_LANGINFO
S_my_langinfo(const nl_item item, bool toggle)
# else
S_my_langinfo(const int item, bool toggle)
# endif
{

dTHX;
Expand Down

0 comments on commit d6bac4d

Please sign in to comment.