Skip to content

Commit

Permalink
internal/numbers.h: Add fallback implementation for UINT32_C and UINT…
Browse files Browse the repository at this point in the history
…64_C

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 #21951)
  • Loading branch information
levitte committed Sep 4, 2023
1 parent cfbdc5d commit 09a4b4b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
25 changes: 25 additions & 0 deletions include/internal/numbers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions test/quic_multistream_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 09a4b4b

Please sign in to comment.