--- embedaddon/smartmontools/os_win32/wmiquery.h 2012/02/21 16:32:16 1.1.1.1 +++ embedaddon/smartmontools/os_win32/wmiquery.h 2012/10/09 09:36:45 1.1.1.2 @@ -18,7 +18,7 @@ #ifndef WMIQUERY_H #define WMIQUERY_H -#define WMIQUERY_H_CVSID "$Id: wmiquery.h,v 1.1.1.1 2012/02/21 16:32:16 misho Exp $" +#define WMIQUERY_H_CVSID "$Id: wmiquery.h,v 1.1.1.2 2012/10/09 09:36:45 misho Exp $" #ifdef HAVE_WBEMCLI_H #include @@ -28,8 +28,13 @@ #include -#if !defined(__GNUC__) && !defined(__attribute__) -#define __attribute__(x) /**/ +#ifndef __GNUC__ +#define __attribute_format_printf(x, y) /**/ +#elif defined(__MINGW32__) && __USE_MINGW_ANSI_STDIO +// Check format of __mingw_*printf() instead of MSVCRT.DLL:*printf() +#define __attribute_format_printf(x, y) __attribute__((format (gnu_printf, x, y))) +#else +#define __attribute_format_printf(x, y) __attribute__((format (printf, x, y))) #endif ///////////////////////////////////////////////////////////////////////////// @@ -171,11 +176,11 @@ class wbem_services (public) /// Version of vquery() with printf() formatting. bool query(wbem_enumerator & result, const char * qstr, ...) /*const*/ - __attribute__ ((format (printf, 3, 4))); + __attribute_format_printf(3, 4); /// Version of vquery1() with printf() formatting. bool query1(wbem_object & obj, const char * qstr, ...) /*const*/ - __attribute__ ((format (printf, 3, 4))); + __attribute_format_printf(3, 4); private: com_intf_ptr m_intf;