]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
numbers: Define 128-bit integers if compiler supports
authorAmitay Isaacs <amitay@ozlabs.org>
Mon, 29 Mar 2021 07:06:13 +0000 (18:06 +1100)
committerMatt Caswell <matt@openssl.org>
Thu, 8 Apr 2021 11:18:09 +0000 (12:18 +0100)
Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14784)

include/internal/numbers.h

index fc93e59c4bacbcbc346068c2b42fa77e0a196ea5..ac801364d919291008e92f37418f419ddeb3a8dc 100644 (file)
 #  define UINT64_MAX __MAXUINT__(uint64_t)
 # endif
 
+# ifndef INT128_MAX
+#  if defined(__SIZEOF_INT128__) && __SIZEOF_INT128__ == 16
+typedef __int128_t int128_t;
+typedef __uint128_t uint128_t;
+#   define INT128_MIN __MININT__(int128_t)
+#   define INT128_MAX __MAXINT__(int128_t)
+#   define UINT128_MAX __MAXUINT__(uint128_t)
+#  endif
+# endif
+
 # ifndef SIZE_MAX
 #  define SIZE_MAX __MAXUINT__(size_t)
 # endif