summaryrefslogtreecommitdiff
path: root/common/compat.h
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/compat.h
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/compat.h')
-rw-r--r--common/compat.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/compat.h b/common/compat.h
index 96a731d..d78db0c 100644
--- a/common/compat.h
+++ b/common/compat.h
@@ -340,6 +340,12 @@ int fdwalk (int (* cb) (void *data, int fd),
#endif
+/* If either locale_t or newlocale() is not available, strerror_l()
+ * cannot be used */
+#if !defined(HAVE_LOCALE_T) || !defined(HAVE_NEWLOCALE)
+#undef HAVE_STRERROR_L
+#endif
+
int p11_ascii_tolower (int c);
int p11_ascii_toupper (int c);