diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2022-07-21 13:08:10 +0900 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2022-07-21 13:08:10 +0900 |
commit | 3494140847cb8056d017418fefa25e7bbcfaa32c (patch) | |
tree | a8168ee17b9245633a27a6ab02b5227f741a6e01 /src | |
parent | 434a58d0e784958d56ad4eceebec10ee97933108 (diff) | |
download | libgcrypt-3494140847cb8056d017418fefa25e7bbcfaa32c.tar.gz |
Cleanup for type definitions of byte, ushort, u32, and u64.
* src/types.h: Use macros defined by configure script.
* src/hmac256.c: Fix for HAVE_U32.
* cipher/poly1305.c: Fix for HAVE_U64.
--
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/hmac256.c | 8 | ||||
-rw-r--r-- | src/types.h | 26 |
2 files changed, 17 insertions, 17 deletions
diff --git a/src/hmac256.c b/src/hmac256.c index 899e6d15..bfce9f8a 100644 --- a/src/hmac256.c +++ b/src/hmac256.c @@ -35,7 +35,7 @@ WORDS_BIGENDIAN Defined to 1 on big endian systems. inline If defined, it should yield the keyword used to inline a function. - HAVE_TYPE_U32 Defined if the u32 type is available. + HAVE_U32 Defined if the u32 type is available. SIZEOF_UNSIGNED_INT Defined to the size in bytes of an unsigned int. SIZEOF_UNSIGNED_LONG Defined to the size in bytes of an unsigned long. @@ -50,7 +50,7 @@ # define KEY_FOR_BINARY_CHECK "What am I, a doctor or a moonshuttle conductor?" # endif #include <stdint.h> -#define HAVE_TYPE_U32 1 +#define HAVE_U32 1 typedef uint32_t u32; #define VERSION "standalone" /* For GCC, we can detect endianness. If not GCC, please define manually. */ @@ -82,7 +82,7 @@ typedef uint32_t u32; -#ifndef HAVE_TYPE_U32 +#ifndef HAVE_U32 # undef u32 /* Undef a possible macro with that name. */ # if SIZEOF_UNSIGNED_INT == 4 typedef unsigned int u32; @@ -91,7 +91,7 @@ typedef uint32_t u32; # else # error no typedef for u32 # endif -# define HAVE_TYPE_U32 +# define HAVE_U32 #endif diff --git a/src/types.h b/src/types.h index b4f28bc4..8b69dce9 100644 --- a/src/types.h +++ b/src/types.h @@ -54,23 +54,23 @@ -#ifndef HAVE_TYPE_BYTE +#ifndef HAVE_BYTE # undef byte /* In case there is a macro with that name. */ # if !(defined(_WIN32) && defined(cbNDRContext)) /* Windows typedefs byte in the rpc headers. Avoid warning about double definition. */ typedef unsigned char byte; # endif -# define HAVE_TYPE_BYTE +# define HAVE_BYTE #endif -#ifndef HAVE_TYPE_USHORT +#ifndef HAVE_USHORT # undef ushort /* In case there is a macro with that name. */ typedef unsigned short ushort; -# define HAVE_TYPE_USHORT +# define HAVE_USHORT #endif -#ifndef HAVE_TYPE_U16 +#ifndef HAVE_U16 # undef u16 /* In case there is a macro with that name. */ # if SIZEOF_UNSIGNED_INT == 2 typedef unsigned int u16; @@ -79,10 +79,10 @@ # else # error no typedef for u16 # endif -# define HAVE_TYPE_U16 +# define HAVE_U16 #endif -#ifndef HAVE_TYPE_U32 +#ifndef HAVE_U32 # undef u32 /* In case there is a macro with that name. */ # if SIZEOF_UNSIGNED_INT == 4 typedef unsigned int u32; @@ -91,7 +91,7 @@ # else # error no typedef for u32 # endif -# define HAVE_TYPE_U32 +# define HAVE_U32 #endif /* @@ -99,24 +99,24 @@ * the dummy code in cipher/md.c is not available. Examples are * Solaris and IRIX. */ -#ifndef HAVE_TYPE_U64 +#ifndef HAVE_U64 # undef u64 /* In case there is a macro with that name. */ # if SIZEOF_UINT64_T == 8 typedef uint64_t u64; # define U64_C(c) (UINT64_C(c)) -# define HAVE_TYPE_U64 +# define HAVE_U64 # elif SIZEOF_UNSIGNED_INT == 8 typedef unsigned int u64; # define U64_C(c) (c ## U) -# define HAVE_TYPE_U64 +# define HAVE_U64 # elif SIZEOF_UNSIGNED_LONG == 8 typedef unsigned long u64; # define U64_C(c) (c ## UL) -# define HAVE_TYPE_U64 +# define HAVE_U64 # elif SIZEOF_UNSIGNED_LONG_LONG == 8 typedef unsigned long long u64; # define U64_C(c) (c ## ULL) -# define HAVE_TYPE_U64 +# define HAVE_U64 # else # error No way to declare a 64 bit integer type # endif |