mirror of
https://github.com/qemu/qemu.git
synced 2026-02-04 02:24:51 +00:00
qga/vss-win32: Fix ConvertStringToBSTR redefinition with newer MinGW
Newer versions of MinGW-w64 provide ConvertStringToBSTR() in the _com_util namespace via <comutil.h>. This causes a redefinition error when building qemu-ga on Windows with these toolchains. Add a meson check to detect whether ConvertStringToBSTR is already available, and conditionally compile our fallback implementation only when the system does not provide one. Signed-off-by: Nguyen Dinh Phi <phind.uet@gmail.com> Suggested-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Kostiantyn Kostiuk <kkostiuk@redhat.com> Message-ID: <20251218085446.462827-2-phind.uet@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
committed by
Philippe Mathieu-Daudé
parent
0f9150b250
commit
c1df49269a
@@ -549,6 +549,7 @@ STDAPI DllUnregisterServer(void)
|
||||
|
||||
|
||||
/* Support function to convert ASCII string into BSTR (used in _bstr_t) */
|
||||
#ifndef CONFIG_CONVERT_STRING_TO_BSTR
|
||||
namespace _com_util
|
||||
{
|
||||
BSTR WINAPI ConvertStringToBSTR(const char *ascii) {
|
||||
@@ -566,6 +567,7 @@ namespace _com_util
|
||||
return bstr;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Stop QGA VSS provider service using Winsvc API */
|
||||
STDAPI StopService(void)
|
||||
|
||||
Reference in New Issue
Block a user