#ifndef WMIQUERY_H
#define WMIQUERY_H
-#define WMIQUERY_H_CVSID "$Id: wmiquery.h 3243 2011-01-19 20:03:47Z chrfranke $"
+#define WMIQUERY_H_CVSID "$Id: wmiquery.h 3475 2011-11-10 21:43:40Z chrfranke $"
#ifdef HAVE_WBEMCLI_H
#include <wbemcli.h>
#include <string>
-#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
/////////////////////////////////////////////////////////////////////////////
/// 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<IWbemServices> m_intf;