From df01365a0f37f3d8e548e3f8a04fe86847e515ca Mon Sep 17 00:00:00 2001 From: Alexis Engelke Date: Mon, 8 Jul 2024 17:05:27 +0200 Subject: [PATCH] encode-test: MSVC compatibility --- encode2-test.c | 2 +- encode2-test.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/encode2-test.c b/encode2-test.c index 4699640..c807f47 100644 --- a/encode2-test.c +++ b/encode2-test.c @@ -15,7 +15,7 @@ void print_hex(const uint8_t* buf, size_t len) { static int check(const uint8_t* buf, const void* exp, size_t exp_len, unsigned res, const char* name) { - if (__builtin_expect(res == exp_len && !memcmp(buf, exp, exp_len), 1)) + if (res == exp_len && !memcmp(buf, exp, exp_len)) return 0; printf("Failed case (new) %s:\n", name); printf(" Exp (%2zu): ", exp_len); diff --git a/encode2-test.cc b/encode2-test.cc index 77b296d..b6a8331 100644 --- a/encode2-test.cc +++ b/encode2-test.cc @@ -17,7 +17,7 @@ void print_hex(const uint8_t* buf, size_t len) { static int check(const Buffer& buf, const char* exp, size_t exp_len, unsigned res, const char* name) { - if (__builtin_expect(res == exp_len && !std::memcmp(buf.data(), exp, exp_len), 1)) + if (res == exp_len && !std::memcmp(buf.data(), exp, exp_len)) return 0; std::printf("Failed case (new) %s:\n", name); std::printf(" Exp (%2zu): ", exp_len);