diff options
author | Tomas Mraz <tomas@openssl.org> | 2022-05-04 16:58:06 +0200 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2022-05-13 08:30:41 +0200 |
commit | b98f989e0c741d7534a58ba3fb22f5af0f016ca4 (patch) | |
tree | dca8f71bc7f5d7513e584ff061baf2fd257638a0 /test/localetest.c | |
parent | 615525bd4d6bbc56601fbdc82e7ac20344f48872 (diff) | |
download | openssl-new-b98f989e0c741d7534a58ba3fb22f5af0f016ca4.tar.gz |
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/18282)
Diffstat (limited to 'test/localetest.c')
-rw-r--r-- | test/localetest.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/test/localetest.c b/test/localetest.c index 270236a72d..9f13d38550 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> @@ -6,12 +14,12 @@ #include "testutil/output.h" #include <stdlib.h> -#include <locale.h> -#ifdef OPENSSL_SYS_WINDOWS -# define strcasecmp _stricmp -#else -# include <strings.h> -#endif +#include "internal/e_os.h" +#ifndef OPENSSL_NO_LOCALE +# include <locale.h> +# ifdef OPENSSL_SYS_MACOSX +# include <xlocale.h> +# endif int setup_tests(void) { @@ -117,7 +125,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) { } |