From: Richard Levitte Date: Mon, 4 Sep 2023 15:54:22 +0000 (+0200) Subject: internal/numbers.h: Add fallback implementation for UINT32_C and UINT64_C X-Git-Tag: openssl-3.2.0-alpha1~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=09a4b4b72204f973804d60096c513f5ed6b39e4f;p=thirdparty%2Fopenssl.git internal/numbers.h: Add fallback implementation for UINT32_C and UINT64_C Other similar macros can be implemented later. Right now, this are the most likely to be actually useful Reviewed-by: Dmitry Belyavskiy Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/21951) --- diff --git a/include/internal/numbers.h b/include/internal/numbers.h index 4f4d3306d5d..41fd693bd1d 100644 --- a/include/internal/numbers.h +++ b/include/internal/numbers.h @@ -61,6 +61,31 @@ # define UINT64_MAX __MAXUINT__(uint64_t) # endif +/* + * 64-bit processor with LP64 ABI + */ +# ifdef SIXTY_FOUR_BIT_LONG +# ifndef UINT32_C +# define UINT32_C(c) (c) +# endif +# ifndef UINT64_C +# define UINT64_C(c) (c##UL) +# endif +# endif + +/* + * 64-bit processor other than LP64 ABI + */ +# ifdef SIXTY_FOUR_BIT +# ifndef UINT32_C +# define UINT32_C(c) (c##UL) +# endif +# ifndef UINT64_C +# define UINT64_C(c) (c##ULL) +# endif +# endif + + # ifndef INT128_MAX # if defined(__SIZEOF_INT128__) && __SIZEOF_INT128__ == 16 typedef __int128_t int128_t; diff --git a/test/quic_multistream_test.c b/test/quic_multistream_test.c index 895a6d74a70..04f2771ed89 100644 --- a/test/quic_multistream_test.c +++ b/test/quic_multistream_test.c @@ -18,6 +18,7 @@ #if defined(OPENSSL_THREADS) # include "internal/thread_arch.h" #endif +#include "internal/numbers.h" /* UINT64_C */ static const char *certfile, *keyfile;