x3daudio: fix lib exports
1. in case of x3daudio1_{0,1,2}, two exported functions are for some reason decorated (though only on 32bit) 2. tests show these functions should be stdcall, not cdecl; more exactly, header for 1.1 shows that too (1.7 header shows that changed at some point)
Signed-off-by: Rafał Mużyło galtgendo@o2.pl
On Mon, Sep 30, 2019 at 11:34:34PM +0200, Rafał Mużyło wrote:
--- a/dlls/x3daudio1_0/x3daudio1_0.spec 2019-08-30 22:11:51.000000000 +0200 +++ b/dlls/x3daudio1_0/x3daudio1_0.spec 2019-09-24 13:02:59.151295631 +0200 @@ -1,2 +1,4 @@ -@ cdecl X3DAudioCalculate(ptr ptr ptr long ptr) -@ cdecl X3DAudioInitialize(long float ptr) LEGACY_X3DAudioInitialize +@ stdcall -arch=win32 _X3DAudioCalculate@20(ptr ptr ptr long ptr) LEGACY_X3DAudioCalculate +@ stdcall -arch=win32 _X3DAudioInitialize@12(long float ptr) LEGACY_X3DAudioInitialize +@ stdcall -arch=win64 X3DAudioCalculate(ptr ptr ptr long ptr) LEGACY_X3DAudioCalculate +@ stdcall -arch=win64 X3DAudioInitialize(long float ptr) LEGACY_X3DAudioInitialize --- a/dlls/x3daudio1_1/x3daudio1_1.spec 2019-08-30 22:11:51.000000000 +0200 +++ b/dlls/x3daudio1_1/x3daudio1_1.spec 2019-09-24 13:02:59.151295631 +0200 @@ -1,2 +1,4 @@ -@ cdecl X3DAudioCalculate(ptr ptr ptr long ptr) -@ cdecl X3DAudioInitialize(long float ptr) LEGACY_X3DAudioInitialize +@ stdcall -arch=win32 _X3DAudioCalculate@20(ptr ptr ptr long ptr) LEGACY_X3DAudioCalculate +@ stdcall -arch=win32 _X3DAudioInitialize@12(long float ptr) LEGACY_X3DAudioInitialize +@ stdcall -arch=win64 X3DAudioCalculate(ptr ptr ptr long ptr) LEGACY_X3DAudioCalculate +@ stdcall -arch=win64 X3DAudioInitialize(long float ptr) LEGACY_X3DAudioInitialize --- a/dlls/x3daudio1_2/x3daudio1_2.spec 2019-08-30 22:11:51.000000000 +0200 +++ b/dlls/x3daudio1_2/x3daudio1_2.spec 2019-09-24 13:02:59.151295631 +0200 @@ -1,2 +1,4 @@ -@ cdecl X3DAudioCalculate(ptr ptr ptr long ptr) -@ cdecl X3DAudioInitialize(long float ptr) LEGACY_X3DAudioInitialize +@ stdcall -arch=win32 _X3DAudioCalculate@20(ptr ptr ptr long ptr) LEGACY_X3DAudioCalculate +@ stdcall -arch=win32 _X3DAudioInitialize@12(long float ptr) LEGACY_X3DAudioInitialize +@ stdcall -arch=win64 X3DAudioCalculate(ptr ptr ptr long ptr) LEGACY_X3DAudioCalculate +@ stdcall -arch=win64 X3DAudioInitialize(long float ptr) LEGACY_X3DAudioInitialize
I'm not the right person to review this part. Does it look OK to you, Nikolay?
--- a/dlls/xaudio2_7/x3daudio.c 2019-08-30 22:11:51.000000000 +0200 +++ b/dlls/xaudio2_7/x3daudio.c 2019-09-24 14:18:33.519066671 +0200 @@ -63,7 +63,11 @@ HRESULT CDECL X3DAudioInitialize(UINT32 #endif /* XAUDIO2_VER >= 8 */
#ifdef X3DAUDIO1_VER +#if X3DAUDIO1_VER <= 2 +void WINAPI LEGACY_X3DAudioInitialize(UINT32 chanmask, float speedofsound, +#else void CDECL LEGACY_X3DAudioInitialize(UINT32 chanmask, float speedofsound, +#endif X3DAUDIO_HANDLE handle) { TRACE("0x%x, %f, %p\n", chanmask, speedofsound, handle);
It's awkward to split the function signature like that. Could you either duplicate the whole signature, or, add a X3DAUDIO1_CONVENTION or something? Same for the below chunk.
By the way, does this fix a bug?
Thanks, Andrew
@@ -72,7 +72,11 @@ void CDECL LEGACY_X3DAudioInitialize(UIN #endif /* X3DAUDIO1_VER */
#if XAUDIO2_VER >= 8 || defined X3DAUDIO1_VER +#if defined(X3DAUDIO1_VER) && X3DAUDIO1_VER <= 2 +void WINAPI LEGACY_X3DAudioCalculate(const X3DAUDIO_HANDLE handle, +#else void CDECL X3DAudioCalculate(const X3DAUDIO_HANDLE handle, +#endif const X3DAUDIO_LISTENER *listener, const X3DAUDIO_EMITTER *emitter, UINT32 flags, X3DAUDIO_DSP_SETTINGS *out) {
On 10/1/19 10:19 PM, Andrew Eikum wrote:
On Mon, Sep 30, 2019 at 11:34:34PM +0200, Rafał Mużyło wrote:
--- a/dlls/x3daudio1_0/x3daudio1_0.spec 2019-08-30 22:11:51.000000000 +0200 +++ b/dlls/x3daudio1_0/x3daudio1_0.spec 2019-09-24 13:02:59.151295631 +0200 @@ -1,2 +1,4 @@ -@ cdecl X3DAudioCalculate(ptr ptr ptr long ptr) -@ cdecl X3DAudioInitialize(long float ptr) LEGACY_X3DAudioInitialize +@ stdcall -arch=win32 _X3DAudioCalculate@20(ptr ptr ptr long ptr) LEGACY_X3DAudioCalculate +@ stdcall -arch=win32 _X3DAudioInitialize@12(long float ptr) LEGACY_X3DAudioInitialize +@ stdcall -arch=win64 X3DAudioCalculate(ptr ptr ptr long ptr) LEGACY_X3DAudioCalculate +@ stdcall -arch=win64 X3DAudioInitialize(long float ptr) LEGACY_X3DAudioInitialize --- a/dlls/x3daudio1_1/x3daudio1_1.spec 2019-08-30 22:11:51.000000000 +0200 +++ b/dlls/x3daudio1_1/x3daudio1_1.spec 2019-09-24 13:02:59.151295631 +0200 @@ -1,2 +1,4 @@ -@ cdecl X3DAudioCalculate(ptr ptr ptr long ptr) -@ cdecl X3DAudioInitialize(long float ptr) LEGACY_X3DAudioInitialize +@ stdcall -arch=win32 _X3DAudioCalculate@20(ptr ptr ptr long ptr) LEGACY_X3DAudioCalculate +@ stdcall -arch=win32 _X3DAudioInitialize@12(long float ptr) LEGACY_X3DAudioInitialize +@ stdcall -arch=win64 X3DAudioCalculate(ptr ptr ptr long ptr) LEGACY_X3DAudioCalculate +@ stdcall -arch=win64 X3DAudioInitialize(long float ptr) LEGACY_X3DAudioInitialize --- a/dlls/x3daudio1_2/x3daudio1_2.spec 2019-08-30 22:11:51.000000000 +0200 +++ b/dlls/x3daudio1_2/x3daudio1_2.spec 2019-09-24 13:02:59.151295631 +0200 @@ -1,2 +1,4 @@ -@ cdecl X3DAudioCalculate(ptr ptr ptr long ptr) -@ cdecl X3DAudioInitialize(long float ptr) LEGACY_X3DAudioInitialize +@ stdcall -arch=win32 _X3DAudioCalculate@20(ptr ptr ptr long ptr) LEGACY_X3DAudioCalculate +@ stdcall -arch=win32 _X3DAudioInitialize@12(long float ptr) LEGACY_X3DAudioInitialize +@ stdcall -arch=win64 X3DAudioCalculate(ptr ptr ptr long ptr) LEGACY_X3DAudioCalculate +@ stdcall -arch=win64 X3DAudioInitialize(long float ptr) LEGACY_X3DAudioInitialize
I'm not the right person to review this part. Does it look OK to you, Nikolay?
Looks ok, for x86 case. I don't have arm setup to see if has to be adjusted there.
I don't know if calling convention change is correct, for win64 ones in particular.
--- a/dlls/xaudio2_7/x3daudio.c 2019-08-30 22:11:51.000000000 +0200 +++ b/dlls/xaudio2_7/x3daudio.c 2019-09-24 14:18:33.519066671 +0200 @@ -63,7 +63,11 @@ HRESULT CDECL X3DAudioInitialize(UINT32 #endif /* XAUDIO2_VER >= 8 */
#ifdef X3DAUDIO1_VER +#if X3DAUDIO1_VER <= 2 +void WINAPI LEGACY_X3DAudioInitialize(UINT32 chanmask, float speedofsound, +#else void CDECL LEGACY_X3DAudioInitialize(UINT32 chanmask, float speedofsound, +#endif X3DAUDIO_HANDLE handle) { TRACE("0x%x, %f, %p\n", chanmask, speedofsound, handle);
It's awkward to split the function signature like that. Could you either duplicate the whole signature, or, add a X3DAUDIO1_CONVENTION or something? Same for the below chunk.
I agree, this will need a macro that will hide version x bitness test.
By the way, does this fix a bug?
Thanks, Andrew
@@ -72,7 +72,11 @@ void CDECL LEGACY_X3DAudioInitialize(UIN #endif /* X3DAUDIO1_VER */
#if XAUDIO2_VER >= 8 || defined X3DAUDIO1_VER +#if defined(X3DAUDIO1_VER) && X3DAUDIO1_VER <= 2 +void WINAPI LEGACY_X3DAudioCalculate(const X3DAUDIO_HANDLE handle, +#else void CDECL X3DAudioCalculate(const X3DAUDIO_HANDLE handle, +#endif const X3DAUDIO_LISTENER *listener, const X3DAUDIO_EMITTER *emitter, UINT32 flags, X3DAUDIO_DSP_SETTINGS *out) {
Nikolay Sivov nsivov@codeweavers.com writes:
On 10/1/19 10:19 PM, Andrew Eikum wrote:
On Mon, Sep 30, 2019 at 11:34:34PM +0200, Rafał Mużyło wrote:
--- a/dlls/x3daudio1_0/x3daudio1_0.spec 2019-08-30 22:11:51.000000000 +0200 +++ b/dlls/x3daudio1_0/x3daudio1_0.spec 2019-09-24 13:02:59.151295631 +0200 @@ -1,2 +1,4 @@ -@ cdecl X3DAudioCalculate(ptr ptr ptr long ptr) -@ cdecl X3DAudioInitialize(long float ptr) LEGACY_X3DAudioInitialize +@ stdcall -arch=win32 _X3DAudioCalculate@20(ptr ptr ptr long ptr) LEGACY_X3DAudioCalculate +@ stdcall -arch=win32 _X3DAudioInitialize@12(long float ptr) LEGACY_X3DAudioInitialize +@ stdcall -arch=win64 X3DAudioCalculate(ptr ptr ptr long ptr) LEGACY_X3DAudioCalculate +@ stdcall -arch=win64 X3DAudioInitialize(long float ptr) LEGACY_X3DAudioInitialize --- a/dlls/x3daudio1_1/x3daudio1_1.spec 2019-08-30 22:11:51.000000000 +0200 +++ b/dlls/x3daudio1_1/x3daudio1_1.spec 2019-09-24 13:02:59.151295631 +0200 @@ -1,2 +1,4 @@ -@ cdecl X3DAudioCalculate(ptr ptr ptr long ptr) -@ cdecl X3DAudioInitialize(long float ptr) LEGACY_X3DAudioInitialize +@ stdcall -arch=win32 _X3DAudioCalculate@20(ptr ptr ptr long ptr) LEGACY_X3DAudioCalculate +@ stdcall -arch=win32 _X3DAudioInitialize@12(long float ptr) LEGACY_X3DAudioInitialize +@ stdcall -arch=win64 X3DAudioCalculate(ptr ptr ptr long ptr) LEGACY_X3DAudioCalculate +@ stdcall -arch=win64 X3DAudioInitialize(long float ptr) LEGACY_X3DAudioInitialize --- a/dlls/x3daudio1_2/x3daudio1_2.spec 2019-08-30 22:11:51.000000000 +0200 +++ b/dlls/x3daudio1_2/x3daudio1_2.spec 2019-09-24 13:02:59.151295631 +0200 @@ -1,2 +1,4 @@ -@ cdecl X3DAudioCalculate(ptr ptr ptr long ptr) -@ cdecl X3DAudioInitialize(long float ptr) LEGACY_X3DAudioInitialize +@ stdcall -arch=win32 _X3DAudioCalculate@20(ptr ptr ptr long ptr) LEGACY_X3DAudioCalculate +@ stdcall -arch=win32 _X3DAudioInitialize@12(long float ptr) LEGACY_X3DAudioInitialize +@ stdcall -arch=win64 X3DAudioCalculate(ptr ptr ptr long ptr) LEGACY_X3DAudioCalculate +@ stdcall -arch=win64 X3DAudioInitialize(long float ptr) LEGACY_X3DAudioInitialize
I'm not the right person to review this part. Does it look OK to you, Nikolay?
Looks ok, for x86 case. I don't have arm setup to see if has to be adjusted there.
There's no stdcall name mangling on ARM, that's x86 only.
x3daudio: fix lib exports
1. in case of x3daudio1_{0,1,2}, two exported functions are for some reason decorated (though only on 32bit) 2. tests show these functions should be stdcall, not cdecl; more exactly, header for 1.1 shows that too (1.7 header shows that changed at some point)
Signed-off-by: Rafał Mużyło galtgendo@o2.pl
Signed-off-by: Andrew Eikum aeikum@codeweavers.com
--- If the spec file changes look OK to someone else, this seems fine to me.
On Fri, Oct 04, 2019 at 01:18:17PM +0200, Rafał Mużyło wrote:
x3daudio: fix lib exports
- in case of x3daudio1_{0,1,2}, two exported functions are for some
reason decorated (though only on 32bit) 2. tests show these functions should be stdcall, not cdecl; more exactly, header for 1.1 shows that too (1.7 header shows that changed at some point)
Signed-off-by: Rafał Mużyło galtgendo@o2.pl
--- a/dlls/x3daudio1_0/x3daudio1_0.spec 2019-08-30 22:11:51.000000000 +0200 +++ b/dlls/x3daudio1_0/x3daudio1_0.spec 2019-09-24 13:02:59.151295631 +0200 @@ -1,2 +1,4 @@ -@ cdecl X3DAudioCalculate(ptr ptr ptr long ptr) -@ cdecl X3DAudioInitialize(long float ptr) LEGACY_X3DAudioInitialize +@ stdcall -arch=win32 _X3DAudioCalculate@20(ptr ptr ptr long ptr) LEGACY_X3DAudioCalculate +@ stdcall -arch=win32 _X3DAudioInitialize@12(long float ptr) LEGACY_X3DAudioInitialize +@ stdcall -arch=win64 X3DAudioCalculate(ptr ptr ptr long ptr) LEGACY_X3DAudioCalculate +@ stdcall -arch=win64 X3DAudioInitialize(long float ptr) LEGACY_X3DAudioInitialize --- a/dlls/x3daudio1_1/x3daudio1_1.spec 2019-08-30 22:11:51.000000000 +0200 +++ b/dlls/x3daudio1_1/x3daudio1_1.spec 2019-09-24 13:02:59.151295631 +0200 @@ -1,2 +1,4 @@ -@ cdecl X3DAudioCalculate(ptr ptr ptr long ptr) -@ cdecl X3DAudioInitialize(long float ptr) LEGACY_X3DAudioInitialize +@ stdcall -arch=win32 _X3DAudioCalculate@20(ptr ptr ptr long ptr) LEGACY_X3DAudioCalculate +@ stdcall -arch=win32 _X3DAudioInitialize@12(long float ptr) LEGACY_X3DAudioInitialize +@ stdcall -arch=win64 X3DAudioCalculate(ptr ptr ptr long ptr) LEGACY_X3DAudioCalculate +@ stdcall -arch=win64 X3DAudioInitialize(long float ptr) LEGACY_X3DAudioInitialize --- a/dlls/x3daudio1_2/x3daudio1_2.spec 2019-08-30 22:11:51.000000000 +0200 +++ b/dlls/x3daudio1_2/x3daudio1_2.spec 2019-09-24 13:02:59.151295631 +0200 @@ -1,2 +1,4 @@ -@ cdecl X3DAudioCalculate(ptr ptr ptr long ptr) -@ cdecl X3DAudioInitialize(long float ptr) LEGACY_X3DAudioInitialize +@ stdcall -arch=win32 _X3DAudioCalculate@20(ptr ptr ptr long ptr) LEGACY_X3DAudioCalculate +@ stdcall -arch=win32 _X3DAudioInitialize@12(long float ptr) LEGACY_X3DAudioInitialize +@ stdcall -arch=win64 X3DAudioCalculate(ptr ptr ptr long ptr) LEGACY_X3DAudioCalculate +@ stdcall -arch=win64 X3DAudioInitialize(long float ptr) LEGACY_X3DAudioInitialize --- a/dlls/xaudio2_7/x3daudio.c 2019-08-30 22:11:51.000000000 +0200 +++ b/dlls/xaudio2_7/x3daudio.c 2019-10-04 13:09:19.302643342 +0200 @@ -63,8 +63,13 @@ HRESULT CDECL X3DAudioInitialize(UINT32 #endif /* XAUDIO2_VER >= 8 */
#ifdef X3DAUDIO1_VER +#if X3DAUDIO1_VER <= 2 +void WINAPI LEGACY_X3DAudioInitialize(UINT32 chanmask, float speedofsound,
X3DAUDIO_HANDLE handle)
+#else void CDECL LEGACY_X3DAudioInitialize(UINT32 chanmask, float speedofsound, X3DAUDIO_HANDLE handle) +#endif { TRACE("0x%x, %f, %p\n", chanmask, speedofsound, handle); F3DAudioInitialize(chanmask, speedofsound, handle); @@ -72,9 +77,15 @@ void CDECL LEGACY_X3DAudioInitialize(UIN #endif /* X3DAUDIO1_VER */
#if XAUDIO2_VER >= 8 || defined X3DAUDIO1_VER +#if defined(X3DAUDIO1_VER) && X3DAUDIO1_VER <= 2 +void WINAPI LEGACY_X3DAudioCalculate(const X3DAUDIO_HANDLE handle,
const X3DAUDIO_LISTENER *listener, const X3DAUDIO_EMITTER *emitter,
UINT32 flags, X3DAUDIO_DSP_SETTINGS *out)
+#else void CDECL X3DAudioCalculate(const X3DAUDIO_HANDLE handle, const X3DAUDIO_LISTENER *listener, const X3DAUDIO_EMITTER *emitter, UINT32 flags, X3DAUDIO_DSP_SETTINGS *out) +#endif { TRACE("%p, %p, %p, 0x%x, %p\n", handle, listener, emitter, flags, out); F3DAudioCalculate(
Andrew Eikum aeikum@codeweavers.com writes:
Signed-off-by: Andrew Eikum aeikum@codeweavers.com
If the spec file changes look OK to someone else, this seems fine to me.
As already mentioned, the stdcall decorations should be i386-only.