From 203ac10a2bec1943c3acf37e0a31b8250544e7e0 Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath <nathbap...@gmail.com> Date: Fri, 21 Aug 2020 20:55:01 +0530 Subject: [PATCH] headers/xaudio2.idl: use cpp_quote for xaudio2 error codes
using cpp_quote and casting to HRESULT type helps to retain HRESULT type in the generated header file. Otherwise, the constants are assumed to be int type. That produces warnings where conversion of int to long are enabled as compiler warning. Signed-off-by: Biswapriyo Nath <nathbap...@gmail.com> --- mingw-w64-headers/include/xaudio2.idl | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/mingw-w64-headers/include/xaudio2.idl b/mingw-w64-headers/include/xaudio2.idl index 074454d..3201e86 100644 --- a/mingw-w64-headers/include/xaudio2.idl +++ b/mingw-w64-headers/include/xaudio2.idl @@ -1243,15 +1243,16 @@ const UINT32 XAUDIO2_QUANTUM_NUMERATOR = 1; const UINT32 XAUDIO2_QUANTUM_DENOMINATOR = 100; const float XAUDIO2_QUANTUM_MS = (1000.0 * XAUDIO2_QUANTUM_NUMERATOR / XAUDIO2_QUANTUM_DENOMINATOR); -const HRESULT XAUDIO2_E_INVALID_CALL = 0x88960001; -const HRESULT XAUDIO2_E_XMA_DECODER_ERROR = 0x88960002; -const HRESULT XAUDIO2_E_XAPO_CREATION_FAILED = 0x88960003; -const HRESULT XAUDIO2_E_DEVICE_INVALIDATED = 0x88960004; +/* use cpp_quote to retain the HRESULT type in header file */ +cpp_quote("#define XAUDIO2_E_INVALID_CALL ((HRESULT)0x88960001)") +cpp_quote("#define XAUDIO2_E_XMA_DECODER_ERROR ((HRESULT)0x88960002)") +cpp_quote("#define XAUDIO2_E_XAPO_CREATION_FAILED ((HRESULT)0x88960003)") +cpp_quote("#define XAUDIO2_E_DEVICE_INVALIDATED ((HRESULT)0x88960004)") /* xaudio 2.0 error codes */ -const HRESULT XAUDIO20_E_XMA_DECODER_ERROR = 0x88960001; -const HRESULT XAUDIO20_E_XAPO_CREATION_FAILED = 0x88960002; -const HRESULT XAUDIO20_E_DEVICE_INVALIDATED = 0x88960003; +cpp_quote("#define XAUDIO20_E_XMA_DECODER_ERROR ((HRESULT)0x88960001)") +cpp_quote("#define XAUDIO20_E_XAPO_CREATION_FAILED ((HRESULT)0x88960002)") +cpp_quote("#define XAUDIO20_E_DEVICE_INVALIDATED ((HRESULT)0x88960003)") cpp_quote("#ifdef XAUDIO2_HELPER_FUNCTIONS") cpp_quote("#define _USE_MATH_DEFINES") -- 2.27.0
_______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public