summaryrefslogtreecommitdiff
path: root/common/library.c
diff options
context:
space:
mode:
authorDaiki Ueno <dueno@redhat.com>2018-05-28 13:33:32 +0200
committerDaiki Ueno <ueno@gnu.org>2018-05-28 16:01:34 +0200
commit79f928492dba6a46c63e77d6b22c17c23e66403b (patch)
treeffe8ac73b67d0d5cabc8607d76d829a5c54c5b82 /common/library.c
parentcd0a2de679a81829b7323bc5db46222b9eaab1d9 (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/library.c')
-rw-r--r--common/library.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/library.c b/common/library.c
index 52c3347..1f0ba41 100644
--- a/common/library.c
+++ b/common/library.c
@@ -70,7 +70,7 @@ pthread_once_t p11_library_once = PTHREAD_ONCE_INIT;
unsigned int p11_forkid = 1;
-#ifdef HAVE_LOCALE_H
+#ifdef HAVE_STRERROR_L
extern locale_t p11_message_locale;
#endif
@@ -130,7 +130,7 @@ p11_library_init_impl (void)
p11_mutex_init (&p11_virtual_mutex);
pthread_key_create (&thread_local, free);
p11_message_storage = thread_local_message;
-#ifdef HAVE_NEWLOCALE
+#ifdef HAVE_STRERROR_L
p11_message_locale = newlocale (LC_ALL_MASK, "POSIX", (locale_t) 0);
#endif
@@ -152,7 +152,7 @@ p11_library_uninit (void)
free (pthread_getspecific (thread_local));
pthread_setspecific (thread_local, NULL);
-#ifdef HAVE_NEWLOCALE
+#ifdef HAVE_STRERROR_L
freelocale (p11_message_locale);
#endif
p11_message_storage = dont_store_message;