]> git.proxmox.com Git - mirror_smartmontools-debian.git/blobdiff - os_win32/wmiquery.h
Imported Upstream version 6.4+svn4214
[mirror_smartmontools-debian.git] / os_win32 / wmiquery.h
index 13dd9888c2aec5764959fbb7aeae3b96dc10fb0e..3000a37545ff62f795117b45bf43dc427d938a7a 100644 (file)
@@ -1,9 +1,9 @@
 /*
  * 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
@@ -18,7 +18,7 @@
 #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
 
 /////////////////////////////////////////////////////////////////////////////
@@ -40,7 +45,7 @@ class com_bstr
 {
 public:
   /// Construct from string.
-  com_bstr(const char * str);
+  explicit com_bstr(const char * str);
 
   /// Destructor frees BSTR.
   ~com_bstr()
@@ -171,11 +176,11 @@ 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<IWbemServices> m_intf;