From 25417a626d0b9077bfbb940952f3858d7b8b549b Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 31 Jan 2012 08:32:06 +0100 Subject: windows: fix format string attributes on MinGW MinGW maps the "printf" format string archetype to the non-standard MSVCRT functions, even if __USE_MINGW_ANSI_STDIO is defined and set to 1. We need to use "gnu_printf" to use the format strings as provided by vsnprintf and similar functions to get correct warnings. Since "gnu_printf" isn't necessarily available on other GCC compatible compilers (such as clang), do this only on MinGW. --- talloc.h | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'talloc.h') diff --git a/talloc.h b/talloc.h index b60e0fb040..e98dbae902 100644 --- a/talloc.h +++ b/talloc.h @@ -29,6 +29,8 @@ #include #include +#include "mpcommon.h" + /* HACK: libsmbclient uses dynamically linked libtalloc.so which has * identically named symbols. This name collision caused a crash under * stream_smb when trying to play anything with smb://. This hack @@ -54,18 +56,6 @@ typedef void TALLOC_CTX; #define TALLOC_DEPRECATED 0 #endif -#ifndef PRINTF_ATTRIBUTE -#if (__GNUC__ >= 3) -/** Use gcc attribute to check printf fns. a1 is the 1-based index of - * the parameter containing the format, and a2 the index of the first - * argument. Note that some gcc 2.x versions don't handle this - * properly **/ -#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2))) -#else -#define PRINTF_ATTRIBUTE(a1, a2) -#endif -#endif - /* try to make talloc_set_destructor() and talloc_steal() type safe, if we have a recent gcc */ #if (__GNUC__ >= 3) -- cgit v1.2.3