qga: vss-win32: Fix build failure
cover qga: vss-win32: Fix build failure
Hello,
These patches are to fix recent build failures of qemu-guest-agent for Windows when fsfreeze using VSS is enabled by:
./configure --cross-prefix=i686-w64-mingw32- --with-vss-sdk=yes
---
Tomoki Sekiyama (2):
Makefile: add qga-vss-dll-obj-y to nested variables
vss-win32: Fix build with mingw64-headers-3.1.0
Makefile | 1 + qga/vss-win32/install.cpp | 3 +++ 2 files changed, 4 insertions(+)
Signature · 1 line
Tomoki Sekiyama
PATCH 1/2 Makefile: add qga-vss-dll-obj-y to nested variables
The build rule for qga/vss-win32/qga-vss.dll is broken by commit ba1183da9a10b94611cad88c44a5c6df005f9b55, because it misses qga-vss-dll-obj-y in the list of nested variables.
This fixes build of qga-vss.dll by adding qga-vss-dll-obj-y to the list.
--- Makefile | 1 + 1 file changed, 1 insertion(+)
Makefile +1 -0
@@ -133,6 +133,7 @@ dummy := $(call unnest-vars,, \ stub-obj-y \ util-obj-y \ qga-obj-y \ + qga-vss-dll-obj-y \ block-obj-y \ block-obj-m \ common-obj-y \
PATCH 2/2 vss-win32: Fix build with mingw64-headers-3.1.0
In reply to Tomoki SekiyamaIn mingw64-headers-3.1.0, definition of _com_issue_error() is added, which conflicts with definition in install.cpp. This adds version checking for mingw headers to disable the definition when the headers>=3.1 is used.
--- qga/vss-win32/install.cpp | 3 +++ 1 file changed, 3 insertions(+)
qga/vss-win32/install.cpp +3 -0
@@ -75,10 +75,13 @@ static void errmsg_dialog(DWORD err, const char *text, const char *opt = "") #define chk(status) _chk(hr, status, "Failed to " #status, out) +#if !defined(__MINGW64_VERSION_MAJOR) || !defined(__MINGW64_VERSION_MINOR) || \ + __MINGW64_VERSION_MAJOR * 100 + __MINGW64_VERSION_MINOR < 301 void __stdcall _com_issue_error(HRESULT hr) { errmsg(hr, "Unexpected error in COM"); } +#endif template<class T> HRESULT put_Value(ICatalogObject *pObj, LPCWSTR name, T val)