diff options
author | Richard Levitte <levitte@openssl.org> | 2020-07-09 08:37:46 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-07-11 10:00:33 +0200 |
commit | e23d850ff3281220f33ed78d9ca4fcadfa279565 (patch) | |
tree | 4e7f73d978bb1a7986e0ac27ee61bdab23d66ed2 /test | |
parent | d685fc7a59699aeb17120aebd17a9175ce5930cd (diff) |
Add and use internal header that implements endianness check
This moves test/ossl_test_endian.h to include/internal/endian.h and
thereby makes the macros in there our standard way to check endianness
in run-time.
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
(Merged from https://github.com/openssl/openssl/pull/12390)
Diffstat (limited to 'test')
-rw-r--r-- | test/ossl_test_endian.h | 22 | ||||
-rw-r--r-- | test/params_api_test.c | 2 |
2 files changed, 1 insertions, 23 deletions
diff --git a/test/ossl_test_endian.h b/test/ossl_test_endian.h deleted file mode 100644 index 38711d0d76..0000000000 --- a/test/ossl_test_endian.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2019 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 - */ - -#ifndef OSSL_TEST_OSSL_TEST_ENDIAN_H -# define OSSL_TEST_OSSL_TEST_ENDIAN_H - -# define DECLARE_IS_ENDIAN \ - const union { \ - long one; \ - char little; \ - } ossl_is_endian = { 1 } - -# define IS_LITTLE_ENDIAN (ossl_is_endian.little != 0) -# define IS_BIG_ENDIAN (ossl_is_endian.little == 0) - -#endif diff --git a/test/params_api_test.c b/test/params_api_test.c index 8ba05120c3..7ad974b02a 100644 --- a/test/params_api_test.c +++ b/test/params_api_test.c @@ -11,7 +11,7 @@ #include <string.h> #include "testutil.h" #include "internal/nelem.h" -#include "ossl_test_endian.h" +#include "internal/endian.h" #include <openssl/params.h> #include <openssl/bn.h> |