diff --git a/tests/unit.h b/tests/unit.h index 24e439771..1801df4dd 100644 --- a/tests/unit.h +++ b/tests/unit.h @@ -88,6 +88,16 @@ #define AssertStrGE(x, y) AssertStr(x, y, >=, <) #define AssertStrLE(x, y) AssertStr(x, y, <=, >) +#ifdef WOLF_C89 + +#define AssertPtr(x, y, op, er) do { \ + void* _x = (void*)(x); \ + void* _y = (void*)(y); \ + Assert(_x op _y, ("%s " #op " %s", #x, #y), ("%p " #er " %p", _x, _y)); \ +} while(0) + +#else + #define AssertPtr(x, y, op, er) do { \ PRAGMA_GCC_DIAG_PUSH; \ /* remarkably, without this inhibition, */ \ @@ -102,6 +112,8 @@ PRAGMA_GCC_DIAG_POP; \ } while(0) +#endif + #define AssertPtrEq(x, y) AssertPtr(x, y, ==, !=) #define AssertPtrNE(x, y) AssertPtr(x, y, !=, ==) #define AssertPtrGT(x, y) AssertPtr(x, y, >, <=) diff --git a/wolfssl/wolfcrypt/ed25519.h b/wolfssl/wolfcrypt/ed25519.h index 298e876be..8306f44b1 100644 --- a/wolfssl/wolfcrypt/ed25519.h +++ b/wolfssl/wolfcrypt/ed25519.h @@ -69,7 +69,7 @@ enum { Ed25519 = -1, Ed25519ctx = 0, - Ed25519ph = 1, + Ed25519ph = 1 }; #ifndef WC_ED25519KEY_TYPE_DEFINED @@ -80,7 +80,7 @@ enum { /* ED25519 Flags */ enum { WC_ED25519_FLAG_NONE = 0x00, - WC_ED25519_FLAG_DEC_SIGN = 0x01, + WC_ED25519_FLAG_DEC_SIGN = 0x01 }; /* An ED25519 Key */ diff --git a/wolfssl/wolfcrypt/ed448.h b/wolfssl/wolfcrypt/ed448.h index b9fa35f61..a5845fbe3 100644 --- a/wolfssl/wolfcrypt/ed448.h +++ b/wolfssl/wolfcrypt/ed448.h @@ -69,7 +69,7 @@ enum { Ed448 = 0, - Ed448ph = 1, + Ed448ph = 1 }; #ifndef WC_ED448KEY_TYPE_DEFINED diff --git a/wolfssl/wolfcrypt/sha3.h b/wolfssl/wolfcrypt/sha3.h index 571aaa069..2b9283a03 100644 --- a/wolfssl/wolfcrypt/sha3.h +++ b/wolfssl/wolfcrypt/sha3.h @@ -78,6 +78,8 @@ enum { WC_SHA3_384_BLOCK_SIZE = 104, WC_SHA3_512_BLOCK_SIZE = 72, #endif + + WOLF_ENUM_DUMMY_LAST_ELEMENT(WC_SHA3) }; #ifndef NO_OLD_WC_NAMES diff --git a/wolfssl/wolfcrypt/sha512.h b/wolfssl/wolfcrypt/sha512.h index 4011c7df5..6338700d2 100644 --- a/wolfssl/wolfcrypt/sha512.h +++ b/wolfssl/wolfcrypt/sha512.h @@ -140,7 +140,7 @@ enum { WC_SHA512_256_BLOCK_SIZE = WC_SHA512_BLOCK_SIZE, WC_SHA512_256_DIGEST_SIZE = 32, - WC_SHA512_256_PAD_SIZE = WC_SHA512_PAD_SIZE, + WC_SHA512_256_PAD_SIZE = WC_SHA512_PAD_SIZE };