[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 06/24] qga/commands-win32: Fix problem with redundant protype decl
From: |
Thomas Huth |
Subject: |
[PULL 06/24] qga/commands-win32: Fix problem with redundant protype declaration |
Date: |
Wed, 16 Sep 2020 13:47:13 +0200 |
When compiling QEMU with MSYS2 on Windows, there is currently the
following error:
../qga/commands-win32.c:62:24: error: redundant redeclaration of
'CM_Get_DevNode_PropertyW' [-Werror=redundant-decls]
62 | CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(
| ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../qga/commands-win32.c:26:
C:/tools/msys64/mingw64/x86_64-w64-mingw32/include/cfgmgr32.h:840:26: note:
previous declaration of 'CM_Get_DevNode_PropertyW' was here
840 | CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(DEVINST dnDevInst,
const DEVPROPKEY *PropertyKey, DEVPROPTYPE *PropertyType, PBYTE
PropertyBuffer,
PULONG PropertyBufferSize, ULONG ulFlags);
Seems like this protype is sometimes available in the cfgmgr32.h
header, and sometimes not. Let's silence the compiler warning here
to let the build pass with -Werror, too.
Message-Id: <20200915114757.55635-1-thuth@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
qga/commands-win32.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index 48d8bbe649..0c3c05484f 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -57,8 +57,10 @@ DEFINE_DEVPROPKEY(qga_DEVPKEY_Device_DriverDate, 0xa8b865dd,
0x2e3d,
DEFINE_DEVPROPKEY(qga_DEVPKEY_Device_DriverVersion, 0xa8b865dd, 0x2e3d,
0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 3);
/* DEVPROP_TYPE_STRING */
-/* The following shoud be in cfgmgr32.h, but it isn't */
+/* The CM_Get_DevNode_PropertyW prototype is only sometimes in cfgmgr32.h */
#ifndef CM_Get_DevNode_Property
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wredundant-decls"
CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(
DEVINST dnDevInst,
CONST DEVPROPKEY * PropertyKey,
@@ -68,6 +70,7 @@ CMAPI CONFIGRET WINAPI CM_Get_DevNode_PropertyW(
ULONG ulFlags
);
#define CM_Get_DevNode_Property CM_Get_DevNode_PropertyW
+#pragma GCC diagnostic pop
#endif
#ifndef SHTDN_REASON_FLAG_PLANNED
--
2.18.2
- [PULL 00/24] qtests, unit tests and Cirrus-CI fixes / improvements, Thomas Huth, 2020/09/16
- [PULL 01/24] iotests: Drop readlink -f, Thomas Huth, 2020/09/16
- [PULL 02/24] fuzz: Change the way we write qtest log to stderr, Thomas Huth, 2020/09/16
- [PULL 03/24] tests/qtest/qmp-cmd-test: Use inclusive language, Thomas Huth, 2020/09/16
- [PULL 04/24] tests/socket-helpers: Treat EAI_NONAME as EADDRNOTAVAIL, Thomas Huth, 2020/09/16
- [PULL 06/24] qga/commands-win32: Fix problem with redundant protype declaration,
Thomas Huth <=
- [PULL 05/24] Simplify the .gitignore file, Thomas Huth, 2020/09/16
- [PULL 08/24] tests: Convert g_free to g_autofree macro in test-logging.c, Thomas Huth, 2020/09/16
- [PULL 07/24] rcu: Implement drain_call_rcu, Thomas Huth, 2020/09/16
- [PULL 10/24] meson: Disable test-char on msys2/mingw for fixing tests stuck, Thomas Huth, 2020/09/16
- [PULL 09/24] rcu: fixes test-logging.c by call drain_call_rcu before rmdir_full, Thomas Huth, 2020/09/16
- [PULL 11/24] meson: disable crypto tests are empty under win32, Thomas Huth, 2020/09/16
- [PULL 12/24] tests: Fixes test-replication.c on msys2/mingw., Thomas Huth, 2020/09/16
- [PULL 14/24] osdep: file locking functions are not available on Win32, Thomas Huth, 2020/09/16