summaryrefslogtreecommitdiffstats
path: root/e_os.h
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2022-05-04 16:58:06 +0200
committerTomas Mraz <tomas@openssl.org>2022-05-13 08:33:39 +0200
commit48d2eca1c5abe085425e63a09b63e82408c985ce (patch)
treefec519b963cca92e76b84d5a24fc03c452f6dfbe /e_os.h
parent86290ec1f7ba99f7f454c2541b69082a785b5166 (diff)
Fix build on OPENSSL_SYS_TANDEM and older POSIXes
It also allows for passing -DOPENSSL_NO_LOCALE as a workaround to ./Configure command. Fixes #18233 Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18293)
Diffstat (limited to 'e_os.h')
-rw-r--r--e_os.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/e_os.h b/e_os.h
index 514de967a9..fd45d2088b 100644
--- a/e_os.h
+++ b/e_os.h
@@ -409,4 +409,23 @@ inline int nssgetpid();
# endif
# endif
+/*
+ * str[n]casecmp_l is defined in POSIX 2008-01. Value is taken accordingly
+ * https://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html
+ * There are also equivalent functions on Windows.
+ * There is no locale_t on NONSTOP.
+ */
+# if defined(OPENSSL_SYS_WINDOWS)
+# define locale_t _locale_t
+# define freelocale _free_locale
+# define strcasecmp_l _stricmp_l
+# define strncasecmp_l _strnicmp_l
+# define strcasecmp _stricmp
+# elif !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200809L \
+ || defined(OPENSSL_SYS_TANDEM)
+# ifndef OPENSSL_NO_LOCALE
+# define OPENSSL_NO_LOCALE
+# endif
+# endif
+
#endif