X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=include%2Fwimlib%2Fcompiler.h;h=9f53e192fc52796e2837c016a2f20b479e05d1cf;hp=43ccc7d49f0fd35d7a6c3fe631bfd0c251a2f6c6;hb=908381d2809a48acd9490ec080e51087ae1529fd;hpb=5e3d0c732c29487e19c36110cdc4fb8d5ffe46ad diff --git a/include/wimlib/compiler.h b/include/wimlib/compiler.h index 43ccc7d4..9f53e192 100644 --- a/include/wimlib/compiler.h +++ b/include/wimlib/compiler.h @@ -3,8 +3,21 @@ * * Compiler-specific definitions. Currently, only GCC and clang are supported. * - * The author dedicates this file to the public domain. - * You can do whatever you want with this file. + * The following copying information applies to this specific source code file: + * + * Written in 2013-2016 by Eric Biggers + * + * To the extent possible under law, the author(s) have dedicated all copyright + * and related and neighboring rights to this software to the public domain + * worldwide via the Creative Commons Zero 1.0 Universal Public Domain + * Dedication (the "CC0"). + * + * This software is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the CC0 for more details. + * + * You should have received a copy of the CC0 along with this software; if not + * see . */ #ifndef _WIMLIB_COMPILER_H @@ -179,6 +192,10 @@ # define STATIC_ASSERT(expr) ((void)sizeof(char[1 - 2 * !(expr)])) #endif +/* STATIC_ASSERT_ZERO() - verify the truth of an expression at compilation time + * and also produce a result of value '0' to be used in constant expressions */ +#define STATIC_ASSERT_ZERO(expr) ((int)sizeof(char[-!(expr)])) + #define CONCAT_IMPL(s1, s2) s1##s2 /* CONCAT() - concatenate two tokens at preprocessing time. */