summaryrefslogtreecommitdiffstats
path: root/test
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 /test
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 'test')
-rw-r--r--test/localetest.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/test/localetest.c b/test/localetest.c
index ea80039b3b..0af3fb12e0 100644
--- a/test/localetest.c
+++ b/test/localetest.c
@@ -1,3 +1,11 @@
+/*
+ * Copyright 2022 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
#include <stdio.h>
#include <string.h>
@@ -7,12 +15,12 @@
#include <stdio.h>
#include <stdlib.h>
-#include <locale.h>
-#ifdef OPENSSL_SYS_WINDOWS
-# define strcasecmp _stricmp
-#else
-# include <strings.h>
-#endif
+#include "../e_os.h"
+#ifndef OPENSSL_NO_LOCALE
+# include <locale.h>
+# ifdef OPENSSL_SYS_MACOSX
+# include <xlocale.h>
+# endif
int setup_tests(void)
{
@@ -118,7 +126,12 @@ int setup_tests(void)
X509_free(cert);
return 1;
}
-
+#else
+int setup_tests(void)
+{
+ return TEST_skip("Locale support not available");
+}
+#endif /* OPENSSL_NO_LOCALE */
void cleanup_tests(void)
{
}