diff options
author | Daiki Ueno <dueno@redhat.com> | 2018-05-28 13:33:32 +0200 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2018-05-28 16:01:34 +0200 |
commit | 79f928492dba6a46c63e77d6b22c17c23e66403b (patch) | |
tree | ffe8ac73b67d0d5cabc8607d76d829a5c54c5b82 /common/debug.c | |
parent | cd0a2de679a81829b7323bc5db46222b9eaab1d9 (diff) |
build: Don't use locale funcs if locale_t is not defined in locale.h
On macOS, locale_t is not defined in <locale.h>. Although it is
defined in <xlocale.h>, we rather not use locales at all for POSIX
compliance.
Diffstat (limited to 'common/debug.c')
-rw-r--r-- | common/debug.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/debug.c b/common/debug.c index c731305..bcf6e21 100644 --- a/common/debug.c +++ b/common/debug.c @@ -73,7 +73,7 @@ static bool debug_strict = false; /* global variable exported in debug.h */ int p11_debug_current_flags = ~0; -#ifdef HAVE_LOCALE_H +#ifdef HAVE_STRERROR_L extern locale_t p11_message_locale; #endif @@ -163,7 +163,7 @@ p11_debug_message_err (int flag, va_end (args); snprintf (strerr, sizeof (strerr), "Unknown error %d", errnum); -#if defined(HAVE_STRERROR_L) && defined(HAVE_NEWLOCALE) +#ifdef HAVE_STRERROR_L if (p11_message_locale != (locale_t) 0) strncpy (strerr, strerror_l (errnum, p11_message_locale), sizeof (strerr)); #else |