"porting" issues on windows / visual studio 2005

Hi,

First of, let me thank you for your great work in SDL, i have been using
this library already some years ago, and i’m very glad to see that it’s
still updated and making progress.

I’m currently getting SDL2 (from hg) working in our custom windows build
environment.
To get it to work, i needed to change some things, that may be of interest,
and may even make it to the codebase:

In my setup I don’t have a dxsdkver.h file which is required by
sdl_xaudio2.c, so I would configure SDL_AUDIO_DRIVER_XAUDIO2 to be ‘off’,
but in sdl_xaudio2.c it says ‘#ifdef SDL_AUDIO_DRIVER_XAUDIO2’. I would
propose this to be ‘#if SDL_AUDIO_DRIVER_XAUDIO2’ from my point of view.

When linking I ran into trouble with the ftol2_sse beeing duplicated in the
msvcrt and the sdl library. When switching to HAVE_LIBC in the config,
sdl_gesture.c throws errors because of M_PI beeing undefined. To fix this
it would be required to ‘#define _USE_MATH_DEFINES’ before including
math.h. My proposal would be to define this in SDL_config_windows.h when
HAVE_LIBC is 1.

Also regarding some of the configuration flags only affect the compilation,
these should probably be made configurable from the outside in
sdl_config_windows.h?
e.g.
change
#define SDL_AUDIO_DRIVER_XAUDIO2 1
to
#ifndef SDL_AUDIO_DRIVER_XAUDIO2
#define SDL_AUDIO_DRIVER_XAUDIO2 1
#endif

I would totally understand if these changes don’t make sense to you, but
would appreciate enlightenment :wink:

Greetings,
michael