include: Fix the C_ASSERT macro to not generate an unused variable warning when compiling with gcc.

Alexandre Julliard julliard at winehq.org
Fri Feb 15 04:52:24 CST 2008


Robert Shearman <rob at codeweavers.com> writes:

> @@ -279,10 +279,10 @@ extern "C" {
>  
>  /* Compile time assertion */
>  
> -#if defined(_MSC_VER)
> +#if defined(_MSC_VER) || defined(__GNUC__)
>  # define C_ASSERT(e) typedef char __C_ASSERT__[(e)?1:-1]
> -#elif defined(__GNUC__) 
> -# define C_ASSERT(e) extern char __C_ASSERT__[(e)?1:-1]
> +#else
> +# define C_ASSERT(e)

This will break if you do two C_ASSERTs in the same scope.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list