X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fhash%2Fhash.h;h=3db75753fb503d5fd9b5284a2e6e0698bdf63b26;hp=189c9438c8dfdccd4ba12480b4afa808f2d7f248;hb=3f4e83d8ac847d6bf0c20e88cdbca535e842a97b;hpb=a1d048552e7c9cbd07092cefb87204563a807608 diff --git a/ccan/hash/hash.h b/ccan/hash/hash.h index 189c9438..3db75753 100644 --- a/ccan/hash/hash.h +++ b/ccan/hash/hash.h @@ -91,8 +91,8 @@ * } */ #define hash_stable(p, num, base) \ - (EXPR_BUILD_ASSERT(sizeof(*(p)) == 8 || sizeof(*(p)) == 4 \ - || sizeof(*(p)) == 2 || sizeof(*(p)) == 1) + \ + (BUILD_ASSERT_OR_ZERO(sizeof(*(p)) == 8 || sizeof(*(p)) == 4 \ + || sizeof(*(p)) == 2 || sizeof(*(p)) == 1) + \ sizeof(*(p)) == 8 ? hash_stable_64((p), (num), (base)) \ : sizeof(*(p)) == 4 ? hash_stable_32((p), (num), (base)) \ : sizeof(*(p)) == 2 ? hash_stable_16((p), (num), (base)) \ @@ -220,8 +220,8 @@ static inline uint32_t hash_string(const char *string) * } */ #define hash64_stable(p, num, base) \ - (EXPR_BUILD_ASSERT(sizeof(*(p)) == 8 || sizeof(*(p)) == 4 \ - || sizeof(*(p)) == 2 || sizeof(*(p)) == 1) + \ + (BUILD_ASSERT_OR_ZERO(sizeof(*(p)) == 8 || sizeof(*(p)) == 4 \ + || sizeof(*(p)) == 2 || sizeof(*(p)) == 1) + \ sizeof(*(p)) == 8 ? hash64_stable_64((p), (num), (base)) \ : sizeof(*(p)) == 4 ? hash64_stable_32((p), (num), (base)) \ : sizeof(*(p)) == 2 ? hash64_stable_16((p), (num), (base)) \ @@ -237,8 +237,8 @@ static inline uint32_t hash_string(const char *string) * This is either hash() or hash64(), on 32/64 bit long machines. */ #define hashl(p, num, base) \ - (EXPR_BUILD_ASSERT(sizeof(long) == sizeof(uint32_t) \ - || sizeof(long) == sizeof(uint64_t)) + \ + (BUILD_ASSERT_OR_ZERO(sizeof(long) == sizeof(uint32_t) \ + || sizeof(long) == sizeof(uint64_t)) + \ (sizeof(long) == sizeof(uint64_t) \ ? hash64((p), (num), (base)) : hash((p), (num), (base))))