Make it possible to build a DLL with mingw that's ABI compatible with Visual C++ built applications
authorSam Lantinga <slouken@libsdl.org>
Sat, 20 Oct 2012 00:14:58 -0700
changeset 6594 dccafb0699dc
parent 6593 f20b511e05a6
child 6595 c6402c811a40
Make it possible to build a DLL with mingw that's ABI compatible with Visual C++ built applications
configure
configure.in
include/SDL_config_windows.h
include/SDL_stdinc.h
--- a/configure	Fri Oct 19 21:43:41 2012 -0700
+++ b/configure	Sat Oct 20 00:14:58 2012 -0700
@@ -16934,6 +16934,7 @@
 SOURCES="$SOURCES $srcdir/src/cpuinfo/*.c"
 SOURCES="$SOURCES $srcdir/src/events/*.c"
 SOURCES="$SOURCES $srcdir/src/file/*.c"
+SOURCES="$SOURCES $srcdir/src/libm/*.c"
 SOURCES="$SOURCES $srcdir/src/render/*.c"
 SOURCES="$SOURCES $srcdir/src/render/*/*.c"
 SOURCES="$SOURCES $srcdir/src/stdlib/*.c"
--- a/configure.in	Fri Oct 19 21:43:41 2012 -0700
+++ b/configure.in	Sat Oct 20 00:14:58 2012 -0700
@@ -297,6 +297,7 @@
 SOURCES="$SOURCES $srcdir/src/cpuinfo/*.c"
 SOURCES="$SOURCES $srcdir/src/events/*.c"
 SOURCES="$SOURCES $srcdir/src/file/*.c"
+SOURCES="$SOURCES $srcdir/src/libm/*.c"
 SOURCES="$SOURCES $srcdir/src/render/*.c"
 SOURCES="$SOURCES $srcdir/src/render/*/*.c"
 SOURCES="$SOURCES $srcdir/src/stdlib/*.c"
--- a/include/SDL_config_windows.h	Fri Oct 19 21:43:41 2012 -0700
+++ b/include/SDL_config_windows.h	Sat Oct 20 00:14:58 2012 -0700
@@ -142,14 +142,21 @@
 
 /* Enable various audio drivers */
 #define SDL_AUDIO_DRIVER_DSOUND	1
+#ifndef __GNUC__
 #define SDL_AUDIO_DRIVER_XAUDIO2	1
+#endif
 #define SDL_AUDIO_DRIVER_WINMM	1
 #define SDL_AUDIO_DRIVER_DISK	1
 #define SDL_AUDIO_DRIVER_DUMMY	1
 
 /* Enable various input drivers */
 #define SDL_JOYSTICK_DINPUT	1
+#ifdef __GNUC__
+/* There isn't a compatible dinput.h for mingw as far as I know */
+#define SDL_HAPTIC_DISABLED	1
+#else
 #define SDL_HAPTIC_DINPUT	1
+#endif
 
 /* Enable various shared object loading systems */
 #define SDL_LOADSO_WINDOWS	1
--- a/include/SDL_stdinc.h	Fri Oct 19 21:43:41 2012 -0700
+++ b/include/SDL_stdinc.h	Sat Oct 20 00:14:58 2012 -0700
@@ -340,7 +340,7 @@
 /* We can count on memcpy existing on Mac OS X and being well-tuned. */
 #if defined(__MACOSX__)
 #define SDL_memcpy      memcpy
-#elif defined(__GNUC__) && defined(i386)
+#elif defined(__GNUC__) && defined(i386) && !defined(__WIN32__)
 #define SDL_memcpy(dst, src, len)					  \
 do {									  \
 	int u0, u1, u2;						  	  \