| Summary: | Mingwin build fails on src/audio/xaudio2/SDL_xaudio2.c | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Paulo Assis <pj.assis> |
| Component: | audio | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | blocker | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | x86 | ||
| OS: | Windows (All) | ||
| Attachments: |
patch to enable mingwin build of SDL 2.0
a second version fix for the mingwin build a version 3 of the patch check for gnuc before redefining THIS_ |
||
This patch wouldn't work, since it removes the "this" pointer that XAudio2 expects to pass to the callback. Is the problem that MingW's headers don't have that awful "THIS_" macro? My MingW install doesn't find XAudio2 headers at all, so it never tries to build this code, so I can't tell what the specific problem was. --ryan. Created attachment 1208 [details]
a second version fix for the mingwin build
This is what i get with the current code: /bin/sh ./libtool --mode=compile gcc -g -O3 -DUSING_GENERATED_CONFIG_H -Iinclude -I../include -mmmx -m3dnow -msse -mpreferred-stack-boundary=2 -Wall -MMD -MT build/SDL_xaudio2.lo -c ../src/audio/xaud io2/SDL_xaudio2.c -o build/SDL_xaudio2.lo libtool: compile: gcc -g -O3 -DUSING_GENERATED_CONFIG_H -Iinclude -I../include -mmmx -m3dnow -msse -mpreferred-stack-boundary=2 -Wall -MMD -MT build/SDL_xaudio2.lo -c ../src/audio/xaudio2/SDL_xaudio2 .c -DDLL_EXPORT -DPIC -o build/.libs/SDL_xaudio2.o ../src/audio/xaudio2/SDL_xaudio2.c: In function 'XAUDIO2_DetectDevices': ../src/audio/xaudio2/SDL_xaudio2.c:72:11: warning: unused variable 'ptr' [-Wunused-variable] ../src/audio/xaudio2/SDL_xaudio2.c: In function 'VoiceCBOnVoiceError': ../src/audio/xaudio2/SDL_xaudio2.c:109:1: error: parameter name omitted ../src/audio/xaudio2/SDL_xaudio2.c: In function 'VoiceCBOnStreamEnd': ../src/audio/xaudio2/SDL_xaudio2.c:116:1: error: parameter name omitted ../src/audio/xaudio2/SDL_xaudio2.c: In function VoiceCBOnVoiceProcessPassStart': ../src/audio/xaudio2/SDL_xaudio2.c:117:1: error: parameter name omitted ../src/audio/xaudio2/SDL_xaudio2.c: In function 'VoiceCBOnVoiceProcessPassEnd': ../src/audio/xaudio2/SDL_xaudio2.c:118:1: error: parameter name omitted ../src/audio/xaudio2/SDL_xaudio2.c: In function 'VoiceCBOnBufferStart': ../src/audio/xaudio2/SDL_xaudio2.c:119:1: error: parameter name omitted ../src/audio/xaudio2/SDL_xaudio2.c: In function 'VoiceCBOnLoopEnd': ../src/audio/xaudio2/SDL_xaudio2.c:120:1: error: parameter name omitted ../src/audio/xaudio2/SDL_xaudio2.c: In function 'XAUDIO2_OpenDevice': ../src/audio/xaudio2/SDL_xaudio2.c:240:9: warning: initialization from incompatible pointer type [enabled by default] ../src/audio/xaudio2/SDL_xaudio2.c:240:9: warning: (near initialization for 'callbacks_vtable.OnBufferEnd') [enabled by default] make: *** [build/SDL_xaudio2.lo] Error 1 the THIS_ and THIS macros are defined in basetyps.h: # define THIS_ INTERFACE *, # define THIS INTERFACE * so the problem is that gcc does not accept passing an argument without setting its name. so simply redefining THIS_ like: # define THIS_ INTERFACE *p, and adding an arg name after THIS macro fixes it for me. See second version of the patch. Regards, Paulo Created attachment 1209 [details]
a version 3 of the patch
redefine THIS_ earlier so that it can also be used in VoiceCBOnBufferEnd
Created attachment 1210 [details]
check for gnuc before redefining THIS_
We probably want to check if gcc is being used (or even for mingw ?)
Don't really use windows much so I sometimes forget there are other compilers out there ;D
Fixed, thanks! http://hg.libsdl.org/SDL/rev/722c44cad199 I think we forgot to mark this bug as FIXED. --ryan. |
Created attachment 947 [details] patch to enable mingwin build of SDL 2.0 When building SDL2.0 on mingwin the build process fails on the above file. By using the attached patch I was able to successfully complete the build. Since I don't use any of those functions in my projects, I was not able to test if the patch breaks any functionality, but at least it enables the build process to finish.