X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=include%2Fwimlib%2Fcompiler.h;h=a43bb769fdce9c752e3a75920c6ce48744133579;hb=993d197cac3a09508f2afefe0e2a620d7e43fa1a;hp=c469010bdfa86e178274a7a1d5b64ced21e7d068;hpb=a82a0fbc625a96aabd2a11e79fb6aedf1fe313b3;p=wimlib diff --git a/include/wimlib/compiler.h b/include/wimlib/compiler.h index c469010b..a43bb769 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 @@ -84,8 +97,15 @@ * returns will not alias any pointer previously in use by the program. */ #define _malloc_attribute __attribute__((malloc)) -/* TODO: _format_attribute is currently ignored. */ -#define _format_attribute(type, format_str, format_start) +/* Hint that the annotated function takes a printf()-like format string and + * arguments. This is currently disabled on Windows because MinGW does not + * support this attribute on functions taking wide-character strings. */ +#ifdef __WIN32__ +# define _format_attribute(type, format_str, format_start) +#else +# define _format_attribute(type, format_str, format_start) \ + __attribute__((format(type, format_str, format_start))) +#endif /* Hint that the annotated function is intentionally not used. This might be * the case if the function contains only static assertions. */