From 206dff3f6ae90157ec68b1773ee39ad41628fd70 Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Fri, 8 Dec 2017 23:32:04 +0100 Subject: [PATCH] util: don't redefine static_assert if it's already defined --- src/util.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util.h b/src/util.h index 3d1c674..6cfee08 100644 --- a/src/util.h +++ b/src/util.h @@ -31,10 +31,10 @@ typedef intptr_t ssize_t; #define inline __inline #endif -#if defined(__clang__) || defined(__GNUC__) -/* Polyfill static_assert() for clang and gcc. */ +#if !defined(static_assert) && !defined(_MSC_VER) +/* Polyfill `static_assert` for some versions of clang and gcc. */ #define static_assert(condition, message) typedef __attribute__( \ - (unused)) int __static_assert_##__LINE__[(condition) ? 1 : -1]; + (__unused__)) int __static_assert_##__LINE__[(condition) ? 1 : -1]; #endif WEPOLL_INTERNAL void* util_safe_container_of_helper(void* ptr, size_t offset);