]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
internal/numbers.h: Add fallback implementation for UINT32_C and UINT64_C
authorRichard Levitte <levitte@openssl.org>
Mon, 4 Sep 2023 15:54:22 +0000 (17:54 +0200)
committerRichard Levitte <levitte@openssl.org>
Mon, 4 Sep 2023 16:27:21 +0000 (18:27 +0200)
Other similar macros can be implemented later.  Right now, this are the most
likely to be actually useful

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21951)

include/internal/numbers.h
test/quic_multistream_test.c

index 4f4d3306d5da80dfb21ef4e9b5fb2fc9598b4bec..41fd693bd1d3be58e87f1793a5cfc18041d058ef 100644 (file)
 #  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;
index 895a6d74a70bcc3367618a21092570e136c51363..04f2771ed89ea3806af90b663ef28869d5f02b11 100644 (file)
@@ -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;