Updated Visual C++ build
authorSam Lantinga <slouken@libsdl.org>
Mon, 15 Sep 2008 07:34:36 +0000
changeset 276002aa80d7905f
parent 2759 95fccd9bf262
child 2761 0c544c2eff77
Updated Visual C++ build
VisualC/SDL/SDL.vcproj
src/audio/SDL_audiocvt.c
src/haptic/win32/SDL_syshaptic.c
src/joystick/win32/SDL_dxjoystick.c
src/joystick/win32/SDL_dxjoystick_c.h
src/libm/math.h
src/libm/math_private.h
src/libm/s_floor.c
src/stdlib/SDL_stdlib.c
     1.1 --- a/VisualC/SDL/SDL.vcproj	Mon Sep 15 06:49:23 2008 +0000
     1.2 +++ b/VisualC/SDL/SDL.vcproj	Mon Sep 15 07:34:36 2008 +0000
     1.3 @@ -345,19 +345,39 @@
     1.4  			>
     1.5  		</File>
     1.6  		<File
     1.7 -			RelativePath="..\..\src\video\e_log.h"
     1.8 +			RelativePath="..\..\src\libm\e_log.c"
     1.9  			>
    1.10  		</File>
    1.11  		<File
    1.12 -			RelativePath="..\..\src\video\e_pow.h"
    1.13 +			RelativePath="..\..\src\libm\e_pow.c"
    1.14  			>
    1.15  		</File>
    1.16  		<File
    1.17 -			RelativePath="..\..\src\video\e_sqrt.h"
    1.18 +			RelativePath="..\..\src\libm\e_rem_pio2.c"
    1.19  			>
    1.20  		</File>
    1.21  		<File
    1.22 -			RelativePath="..\..\src\video\math_private.h"
    1.23 +			RelativePath="..\..\src\libm\e_sqrt.c"
    1.24 +			>
    1.25 +		</File>
    1.26 +		<File
    1.27 +			RelativePath="..\..\src\libm\k_cos.c"
    1.28 +			>
    1.29 +		</File>
    1.30 +		<File
    1.31 +			RelativePath="..\..\src\libm\k_rem_pio2.c"
    1.32 +			>
    1.33 +		</File>
    1.34 +		<File
    1.35 +			RelativePath="..\..\src\libm\k_sin.c"
    1.36 +			>
    1.37 +		</File>
    1.38 +		<File
    1.39 +			RelativePath="..\..\src\libm\math.h"
    1.40 +			>
    1.41 +		</File>
    1.42 +		<File
    1.43 +			RelativePath="..\..\src\libm\math_private.h"
    1.44  			>
    1.45  		</File>
    1.46  		<File
    1.47 @@ -365,6 +385,30 @@
    1.48  			>
    1.49  		</File>
    1.50  		<File
    1.51 +			RelativePath="..\..\src\libm\s_copysign.c"
    1.52 +			>
    1.53 +		</File>
    1.54 +		<File
    1.55 +			RelativePath="..\..\src\libm\s_cos.c"
    1.56 +			>
    1.57 +		</File>
    1.58 +		<File
    1.59 +			RelativePath="..\..\src\libm\s_fabs.c"
    1.60 +			>
    1.61 +		</File>
    1.62 +		<File
    1.63 +			RelativePath="..\..\src\libm\s_floor.c"
    1.64 +			>
    1.65 +		</File>
    1.66 +		<File
    1.67 +			RelativePath="..\..\src\libm\s_scalbn.c"
    1.68 +			>
    1.69 +		</File>
    1.70 +		<File
    1.71 +			RelativePath="..\..\src\libm\s_sin.c"
    1.72 +			>
    1.73 +		</File>
    1.74 +		<File
    1.75  			RelativePath="..\..\src\SDL.c"
    1.76  			>
    1.77  		</File>
    1.78 @@ -549,6 +593,10 @@
    1.79  			>
    1.80  		</File>
    1.81  		<File
    1.82 +			RelativePath="..\..\src\haptic\SDL_haptic.c"
    1.83 +			>
    1.84 +		</File>
    1.85 +		<File
    1.86  			RelativePath="..\..\src\stdlib\SDL_iconv.c"
    1.87  			>
    1.88  		</File>
    1.89 @@ -729,6 +777,14 @@
    1.90  			>
    1.91  		</File>
    1.92  		<File
    1.93 +			RelativePath="..\..\src\haptic\win32\SDL_syshaptic.c"
    1.94 +			>
    1.95 +		</File>
    1.96 +		<File
    1.97 +			RelativePath="..\..\src\haptic\SDL_syshaptic.h"
    1.98 +			>
    1.99 +		</File>
   1.100 +		<File
   1.101  			RelativePath="..\..\src\joystick\SDL_sysjoystick.h"
   1.102  			>
   1.103  		</File>
     2.1 --- a/src/audio/SDL_audiocvt.c	Mon Sep 15 06:49:23 2008 +0000
     2.2 +++ b/src/audio/SDL_audiocvt.c	Mon Sep 15 07:34:36 2008 +0000
     2.3 @@ -29,6 +29,8 @@
     2.4  #include "SDL_audio.h"
     2.5  #include "SDL_audio_c.h"
     2.6  
     2.7 +#include "../libm/math.h"
     2.8 +
     2.9  //#define DEBUG_CONVERT
    2.10  
    2.11  /* These are fractional multiplication routines. That is, their inputs
    2.12 @@ -1352,6 +1354,7 @@
    2.13     For now, use RBJ's cookbook coefficients. It might be more
    2.14     optimal to create a Butterworth filter, but this is more difficult.
    2.15  */
    2.16 +#if 0
    2.17  int
    2.18  SDL_BuildIIRLowpass(SDL_AudioCVT * cvt, SDL_AudioFormat format)
    2.19  {
    2.20 @@ -1443,7 +1446,10 @@
    2.21      SDL_memset(cvt->state_buf, 0, 4 * SDL_AUDIO_BITSIZE(format) / 4);
    2.22      cvt->state_pos = 0;
    2.23  #undef convert_fixed
    2.24 +
    2.25 +	return 0;
    2.26  }
    2.27 +#endif
    2.28  
    2.29  /* Apply the lowpass IIR filter to the given SDL_AudioCVT struct */
    2.30  /* This was implemented because it would be much faster than the fir filter, 
    2.31 @@ -1667,7 +1673,7 @@
    2.32                  0.42f - 0.5f * cosf(two_pi_over_m * (float) i) +
    2.33                  0.08f * cosf(four_pi_over_m * (float) i);
    2.34          }
    2.35 -        norm_sum += fabs(fSinc[i]);
    2.36 +        norm_sum += fSinc[i] < 0 ? -fSinc[i] : fSinc[i]; /* fabs(fSinc[i]); */
    2.37      }
    2.38  
    2.39      norm_fact = 1.0f / norm_sum;
     3.1 --- a/src/haptic/win32/SDL_syshaptic.c	Mon Sep 15 06:49:23 2008 +0000
     3.2 +++ b/src/haptic/win32/SDL_syshaptic.c	Mon Sep 15 07:34:36 2008 +0000
     3.3 @@ -29,23 +29,6 @@
     3.4  #include "../../joystick/SDL_sysjoystick.h"     /* For the real SDL_Joystick */
     3.5  #include "../../joystick/win32/SDL_dxjoystick_c.h"      /* For joystick hwdata */
     3.6  
     3.7 -#define WIN32_LEAN_AND_MEAN
     3.8 -#include <windows.h>
     3.9 -
    3.10 -#define DIRECTINPUT_VERSION 0x0700      /* Need at least DirectX 7 for dwStartDelay */
    3.11 -#include <dinput.h>
    3.12 -#include <dxerr8.h>
    3.13 -#ifdef _MSC_VER
    3.14 -#  pragma comment (lib, "dinput8.lib")
    3.15 -#  pragma comment (lib, "dxguid.lib")
    3.16 -#  pragma comment (lib, "dxerr8.lib")
    3.17 -#endif /* _MSC_VER */
    3.18 -
    3.19 -    /* an ISO hack for VisualC++ */
    3.20 -#ifdef _MSC_VER
    3.21 -#define   snprintf   _snprintf
    3.22 -#endif /* _MSC_VER */
    3.23 -
    3.24  
    3.25  #define MAX_HAPTICS  32
    3.26  
    3.27 @@ -122,8 +105,11 @@
    3.28  static void
    3.29  DI_SetError(const char *str, HRESULT err)
    3.30  {
    3.31 +	/*
    3.32      SDL_SetError("Haptic: %s - %s: %s", str,
    3.33                   DXGetErrorString8A(err), DXGetErrorDescription8A(err));
    3.34 +	 */
    3.35 +	SDL_SetError("Haptic error %s", str);
    3.36  }
    3.37  
    3.38  
     4.1 --- a/src/joystick/win32/SDL_dxjoystick.c	Mon Sep 15 06:49:23 2008 +0000
     4.2 +++ b/src/joystick/win32/SDL_dxjoystick.c	Mon Sep 15 07:34:36 2008 +0000
     4.3 @@ -40,10 +40,6 @@
     4.4  #include "../SDL_joystick_c.h"
     4.5  #include "SDL_dxjoystick_c.h"
     4.6  
     4.7 -/* an ISO hack for VisualC++ */
     4.8 -#ifdef _MSC_VER
     4.9 -#define   snprintf	_snprintf
    4.10 -#endif
    4.11  
    4.12  #define INPUT_QSIZE	32      /* Buffer up to 32 input messages */
    4.13  #define MAX_JOYSTICKS	8
    4.14 @@ -79,13 +75,193 @@
    4.15  static int SDL_PrivateJoystickButton_Int(SDL_Joystick * joystick,
    4.16                                           Uint8 button, Uint8 state);
    4.17  
    4.18 +/* Taken from Wine - Thanks! */
    4.19 +DIOBJECTDATAFORMAT dfDIJoystick2[] = {
    4.20 +  { &GUID_XAxis,DIJOFS_X,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
    4.21 +  { &GUID_YAxis,DIJOFS_Y,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
    4.22 +  { &GUID_ZAxis,DIJOFS_Z,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
    4.23 +  { &GUID_RxAxis,DIJOFS_RX,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
    4.24 +  { &GUID_RyAxis,DIJOFS_RY,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
    4.25 +  { &GUID_RzAxis,DIJOFS_RZ,DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
    4.26 +  { &GUID_Slider,DIJOFS_SLIDER(0),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
    4.27 +  { &GUID_Slider,DIJOFS_SLIDER(1),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
    4.28 +  { &GUID_POV,DIJOFS_POV(0),DIDFT_OPTIONAL|DIDFT_POV|DIDFT_ANYINSTANCE,0},
    4.29 +  { &GUID_POV,DIJOFS_POV(1),DIDFT_OPTIONAL|DIDFT_POV|DIDFT_ANYINSTANCE,0},
    4.30 +  { &GUID_POV,DIJOFS_POV(2),DIDFT_OPTIONAL|DIDFT_POV|DIDFT_ANYINSTANCE,0},
    4.31 +  { &GUID_POV,DIJOFS_POV(3),DIDFT_OPTIONAL|DIDFT_POV|DIDFT_ANYINSTANCE,0},
    4.32 +  { NULL,DIJOFS_BUTTON(0),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.33 +  { NULL,DIJOFS_BUTTON(1),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.34 +  { NULL,DIJOFS_BUTTON(2),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.35 +  { NULL,DIJOFS_BUTTON(3),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.36 +  { NULL,DIJOFS_BUTTON(4),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.37 +  { NULL,DIJOFS_BUTTON(5),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.38 +  { NULL,DIJOFS_BUTTON(6),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.39 +  { NULL,DIJOFS_BUTTON(7),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.40 +  { NULL,DIJOFS_BUTTON(8),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.41 +  { NULL,DIJOFS_BUTTON(9),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.42 +  { NULL,DIJOFS_BUTTON(10),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.43 +  { NULL,DIJOFS_BUTTON(11),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.44 +  { NULL,DIJOFS_BUTTON(12),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.45 +  { NULL,DIJOFS_BUTTON(13),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.46 +  { NULL,DIJOFS_BUTTON(14),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.47 +  { NULL,DIJOFS_BUTTON(15),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.48 +  { NULL,DIJOFS_BUTTON(16),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.49 +  { NULL,DIJOFS_BUTTON(17),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.50 +  { NULL,DIJOFS_BUTTON(18),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.51 +  { NULL,DIJOFS_BUTTON(19),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.52 +  { NULL,DIJOFS_BUTTON(20),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.53 +  { NULL,DIJOFS_BUTTON(21),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.54 +  { NULL,DIJOFS_BUTTON(22),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.55 +  { NULL,DIJOFS_BUTTON(23),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.56 +  { NULL,DIJOFS_BUTTON(24),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.57 +  { NULL,DIJOFS_BUTTON(25),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.58 +  { NULL,DIJOFS_BUTTON(26),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.59 +  { NULL,DIJOFS_BUTTON(27),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.60 +  { NULL,DIJOFS_BUTTON(28),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.61 +  { NULL,DIJOFS_BUTTON(29),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.62 +  { NULL,DIJOFS_BUTTON(30),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.63 +  { NULL,DIJOFS_BUTTON(31),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.64 +  { NULL,DIJOFS_BUTTON(32),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.65 +  { NULL,DIJOFS_BUTTON(33),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.66 +  { NULL,DIJOFS_BUTTON(34),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.67 +  { NULL,DIJOFS_BUTTON(35),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.68 +  { NULL,DIJOFS_BUTTON(36),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.69 +  { NULL,DIJOFS_BUTTON(37),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.70 +  { NULL,DIJOFS_BUTTON(38),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.71 +  { NULL,DIJOFS_BUTTON(39),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.72 +  { NULL,DIJOFS_BUTTON(40),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.73 +  { NULL,DIJOFS_BUTTON(41),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.74 +  { NULL,DIJOFS_BUTTON(42),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.75 +  { NULL,DIJOFS_BUTTON(43),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.76 +  { NULL,DIJOFS_BUTTON(44),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.77 +  { NULL,DIJOFS_BUTTON(45),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.78 +  { NULL,DIJOFS_BUTTON(46),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.79 +  { NULL,DIJOFS_BUTTON(47),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.80 +  { NULL,DIJOFS_BUTTON(48),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.81 +  { NULL,DIJOFS_BUTTON(49),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.82 +  { NULL,DIJOFS_BUTTON(50),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.83 +  { NULL,DIJOFS_BUTTON(51),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.84 +  { NULL,DIJOFS_BUTTON(52),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.85 +  { NULL,DIJOFS_BUTTON(53),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.86 +  { NULL,DIJOFS_BUTTON(54),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.87 +  { NULL,DIJOFS_BUTTON(55),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.88 +  { NULL,DIJOFS_BUTTON(56),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.89 +  { NULL,DIJOFS_BUTTON(57),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.90 +  { NULL,DIJOFS_BUTTON(58),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.91 +  { NULL,DIJOFS_BUTTON(59),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.92 +  { NULL,DIJOFS_BUTTON(60),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.93 +  { NULL,DIJOFS_BUTTON(61),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.94 +  { NULL,DIJOFS_BUTTON(62),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.95 +  { NULL,DIJOFS_BUTTON(63),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.96 +  { NULL,DIJOFS_BUTTON(64),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.97 +  { NULL,DIJOFS_BUTTON(65),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.98 +  { NULL,DIJOFS_BUTTON(66),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
    4.99 +  { NULL,DIJOFS_BUTTON(67),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.100 +  { NULL,DIJOFS_BUTTON(68),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.101 +  { NULL,DIJOFS_BUTTON(69),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.102 +  { NULL,DIJOFS_BUTTON(70),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.103 +  { NULL,DIJOFS_BUTTON(71),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.104 +  { NULL,DIJOFS_BUTTON(72),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.105 +  { NULL,DIJOFS_BUTTON(73),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.106 +  { NULL,DIJOFS_BUTTON(74),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.107 +  { NULL,DIJOFS_BUTTON(75),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.108 +  { NULL,DIJOFS_BUTTON(76),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.109 +  { NULL,DIJOFS_BUTTON(77),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.110 +  { NULL,DIJOFS_BUTTON(78),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.111 +  { NULL,DIJOFS_BUTTON(79),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.112 +  { NULL,DIJOFS_BUTTON(80),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.113 +  { NULL,DIJOFS_BUTTON(81),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.114 +  { NULL,DIJOFS_BUTTON(82),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.115 +  { NULL,DIJOFS_BUTTON(83),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.116 +  { NULL,DIJOFS_BUTTON(84),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.117 +  { NULL,DIJOFS_BUTTON(85),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.118 +  { NULL,DIJOFS_BUTTON(86),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.119 +  { NULL,DIJOFS_BUTTON(87),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.120 +  { NULL,DIJOFS_BUTTON(88),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.121 +  { NULL,DIJOFS_BUTTON(89),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.122 +  { NULL,DIJOFS_BUTTON(90),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.123 +  { NULL,DIJOFS_BUTTON(91),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.124 +  { NULL,DIJOFS_BUTTON(92),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.125 +  { NULL,DIJOFS_BUTTON(93),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.126 +  { NULL,DIJOFS_BUTTON(94),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.127 +  { NULL,DIJOFS_BUTTON(95),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.128 +  { NULL,DIJOFS_BUTTON(96),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.129 +  { NULL,DIJOFS_BUTTON(97),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.130 +  { NULL,DIJOFS_BUTTON(98),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.131 +  { NULL,DIJOFS_BUTTON(99),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.132 +  { NULL,DIJOFS_BUTTON(100),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.133 +  { NULL,DIJOFS_BUTTON(101),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.134 +  { NULL,DIJOFS_BUTTON(102),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.135 +  { NULL,DIJOFS_BUTTON(103),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.136 +  { NULL,DIJOFS_BUTTON(104),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.137 +  { NULL,DIJOFS_BUTTON(105),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.138 +  { NULL,DIJOFS_BUTTON(106),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.139 +  { NULL,DIJOFS_BUTTON(107),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.140 +  { NULL,DIJOFS_BUTTON(108),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.141 +  { NULL,DIJOFS_BUTTON(109),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.142 +  { NULL,DIJOFS_BUTTON(110),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.143 +  { NULL,DIJOFS_BUTTON(111),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.144 +  { NULL,DIJOFS_BUTTON(112),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.145 +  { NULL,DIJOFS_BUTTON(113),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.146 +  { NULL,DIJOFS_BUTTON(114),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.147 +  { NULL,DIJOFS_BUTTON(115),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.148 +  { NULL,DIJOFS_BUTTON(116),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.149 +  { NULL,DIJOFS_BUTTON(117),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.150 +  { NULL,DIJOFS_BUTTON(118),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.151 +  { NULL,DIJOFS_BUTTON(119),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.152 +  { NULL,DIJOFS_BUTTON(120),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.153 +  { NULL,DIJOFS_BUTTON(121),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.154 +  { NULL,DIJOFS_BUTTON(122),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.155 +  { NULL,DIJOFS_BUTTON(123),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.156 +  { NULL,DIJOFS_BUTTON(124),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.157 +  { NULL,DIJOFS_BUTTON(125),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.158 +  { NULL,DIJOFS_BUTTON(126),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.159 +  { NULL,DIJOFS_BUTTON(127),DIDFT_OPTIONAL|DIDFT_BUTTON|DIDFT_ANYINSTANCE,0},
   4.160 +  { &GUID_XAxis,FIELD_OFFSET(DIJOYSTATE2,lVX),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
   4.161 +  { &GUID_YAxis,FIELD_OFFSET(DIJOYSTATE2,lVY),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
   4.162 +  { &GUID_ZAxis,FIELD_OFFSET(DIJOYSTATE2,lVZ),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
   4.163 +  { &GUID_RxAxis,FIELD_OFFSET(DIJOYSTATE2,lVRx),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
   4.164 +  { &GUID_RyAxis,FIELD_OFFSET(DIJOYSTATE2,lVRy),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
   4.165 +  { &GUID_RzAxis,FIELD_OFFSET(DIJOYSTATE2,lVRz),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
   4.166 +  { &GUID_Slider,FIELD_OFFSET(DIJOYSTATE2,rglVSlider[0]),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
   4.167 +  { &GUID_Slider,FIELD_OFFSET(DIJOYSTATE2,rglVSlider[1]),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
   4.168 +  { &GUID_XAxis,FIELD_OFFSET(DIJOYSTATE2,lAX),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
   4.169 +  { &GUID_YAxis,FIELD_OFFSET(DIJOYSTATE2,lAY),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
   4.170 +  { &GUID_ZAxis,FIELD_OFFSET(DIJOYSTATE2,lAZ),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
   4.171 +  { &GUID_RxAxis,FIELD_OFFSET(DIJOYSTATE2,lARx),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
   4.172 +  { &GUID_RyAxis,FIELD_OFFSET(DIJOYSTATE2,lARy),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
   4.173 +  { &GUID_RzAxis,FIELD_OFFSET(DIJOYSTATE2,lARz),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
   4.174 +  { &GUID_Slider,FIELD_OFFSET(DIJOYSTATE2,rglASlider[0]),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
   4.175 +  { &GUID_Slider,FIELD_OFFSET(DIJOYSTATE2,rglASlider[1]),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
   4.176 +  { &GUID_XAxis,FIELD_OFFSET(DIJOYSTATE2,lFX),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
   4.177 +  { &GUID_YAxis,FIELD_OFFSET(DIJOYSTATE2,lFY),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
   4.178 +  { &GUID_ZAxis,FIELD_OFFSET(DIJOYSTATE2,lFZ),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
   4.179 +  { &GUID_RxAxis,FIELD_OFFSET(DIJOYSTATE2,lFRx),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
   4.180 +  { &GUID_RyAxis,FIELD_OFFSET(DIJOYSTATE2,lFRy),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
   4.181 +  { &GUID_RzAxis,FIELD_OFFSET(DIJOYSTATE2,lFRz),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
   4.182 +  { &GUID_Slider,FIELD_OFFSET(DIJOYSTATE2,rglFSlider[0]),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
   4.183 +  { &GUID_Slider,FIELD_OFFSET(DIJOYSTATE2,rglFSlider[1]),DIDFT_OPTIONAL|DIDFT_AXIS|DIDFT_ANYINSTANCE,0},
   4.184 +};
   4.185 +
   4.186 +const DIDATAFORMAT c_dfDIJoystick2 = {
   4.187 +    sizeof(DIDATAFORMAT),
   4.188 +    sizeof(DIOBJECTDATAFORMAT),
   4.189 +    DIDF_ABSAXIS,
   4.190 +    sizeof(DIJOYSTATE2),
   4.191 +    SDL_arraysize(dfDIJoystick2),
   4.192 +    dfDIJoystick2
   4.193 +};
   4.194 +
   4.195  
   4.196  /* Convert a DirectInput return code to a text message */
   4.197  static void
   4.198  SetDIerror(const char *function, HRESULT code)
   4.199  {
   4.200 +    /*
   4.201      SDL_SetError("%s() [%s]: %s", function,
   4.202 -                 DXGetErrorString8A(code), DXGetErrorDescription8A(code));
   4.203 +                 DXGetErrorString9A(code), DXGetErrorDescription9A(code));
   4.204 +     */
   4.205 +    SDL_SetError("%s() DirectX error %d", function, code);
   4.206  }
   4.207  
   4.208  
     5.1 --- a/src/joystick/win32/SDL_dxjoystick_c.h	Mon Sep 15 06:49:23 2008 +0000
     5.2 +++ b/src/joystick/win32/SDL_dxjoystick_c.h	Mon Sep 15 07:34:36 2008 +0000
     5.3 @@ -37,15 +37,8 @@
     5.4  #include <windows.h>
     5.5  
     5.6  #define DIRECTINPUT_VERSION 0x0700      /* Need version 7 for force feedback. */
     5.7 +#define INITGUID
     5.8  #include <dinput.h>
     5.9 -#ifdef _MSC_VER
    5.10 -    /* Used for the c_dfDIJoystick2 symbol (no imports are used) */
    5.11 -#   pragma comment (lib, "dinput.lib")
    5.12 -#endif
    5.13 -#include <dxerr8.h>
    5.14 -#ifdef _MSC_VER
    5.15 -#   pragma comment (lib, "dxerr8.lib")
    5.16 -#endif
    5.17  
    5.18  
    5.19  #define MAX_INPUTS	256     /* each joystick can have up to 256 inputs */
     6.1 --- a/src/libm/math.h	Mon Sep 15 06:49:23 2008 +0000
     6.2 +++ b/src/libm/math.h	Mon Sep 15 07:34:36 2008 +0000
     6.3 @@ -25,6 +25,8 @@
     6.4  #include <math.h>
     6.5  #else
     6.6  
     6.7 +/* Math routines from uClibc: http://www.uclibc.org */
     6.8 +
     6.9  extern double __ieee754_log(double x);
    6.10  extern double __ieee754_pow(double x, double y);
    6.11  extern double __ieee754_sqrt(double x);
     7.1 --- a/src/libm/math_private.h	Mon Sep 15 06:49:23 2008 +0000
     7.2 +++ b/src/libm/math_private.h	Mon Sep 15 07:34:36 2008 +0000
     7.3 @@ -24,6 +24,8 @@
     7.4  #define libm_hidden_proto(x)
     7.5  #define libm_hidden_def(x)
     7.6  
     7.7 +typedef unsigned int u_int32_t;
     7.8 +
     7.9  /* The original fdlibm code used statements like:
    7.10  	n0 = ((*(int*)&one)>>29)^1;		* index of high word *
    7.11  	ix0 = *(n0+(int*)&x);			* high word of x *
     8.1 --- a/src/libm/s_floor.c	Mon Sep 15 06:49:23 2008 +0000
     8.2 +++ b/src/libm/s_floor.c	Mon Sep 15 07:34:36 2008 +0000
     8.3 @@ -81,7 +81,7 @@
     8.4                      i0 += 1;
     8.5                  else {
     8.6                      j = i1 + (1 << (52 - j0));
     8.7 -                    if (j < i1)
     8.8 +                    if (j < (u_int32_t)i1)
     8.9                          i0 += 1;        /* got a carry */
    8.10                      i1 = j;
    8.11                  }
     9.1 --- a/src/stdlib/SDL_stdlib.c	Mon Sep 15 06:49:23 2008 +0000
     9.2 +++ b/src/stdlib/SDL_stdlib.c	Mon Sep 15 07:34:36 2008 +0000
     9.3 @@ -640,6 +640,33 @@
     9.4  
     9.5  void
     9.6  __declspec(naked)
     9.7 +_allshr()
     9.8 +{
     9.9 +    /* *INDENT-OFF* */
    9.10 +    __asm {
    9.11 +        cmp         cl,40h
    9.12 +        jae         RETZERO
    9.13 +        cmp         cl,20h
    9.14 +        jae         MORE32
    9.15 +        shrd        eax,edx,cl
    9.16 +        sar         edx,cl
    9.17 +        ret
    9.18 +MORE32:
    9.19 +        mov         eax,edx
    9.20 +        xor         edx,edx
    9.21 +        and         cl,1Fh
    9.22 +        sar         eax,cl
    9.23 +        ret
    9.24 +RETZERO:
    9.25 +        xor         eax,eax
    9.26 +        xor         edx,edx
    9.27 +        ret
    9.28 +    }
    9.29 +    /* *INDENT-ON* */
    9.30 +}
    9.31 +
    9.32 +void
    9.33 +__declspec(naked)
    9.34  _aullshr()
    9.35  {
    9.36      /* *INDENT-OFF* */