/*
* os_win32/wmiquery.h
*
- * Home page of code is: http://smartmontools.sourceforge.net
+ * Home page of code is: http://www.smartmontools.org
*
- * Copyright (C) 2011 Christian Franke <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2011-15 Christian Franke
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#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 4152 2015-10-17 16:08:21Z 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
/////////////////////////////////////////////////////////////////////////////
{
public:
/// Construct from string.
- com_bstr(const char * str);
+ explicit com_bstr(const char * str);
/// Destructor frees BSTR.
~com_bstr()
/// 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;