Fixes for Visual C++ 6.0 with and without the Processor Pack.
1.1 --- a/include/SDL_config_win32.h Sat Jun 16 05:51:51 2007 +0000
1.2 +++ b/include/SDL_config_win32.h Thu Jun 21 18:20:59 2007 +0000
1.3 @@ -46,6 +46,17 @@
1.4 #endif
1.5 #define _UINTPTR_T_DEFINED
1.6 #endif
1.7 +/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
1.8 +#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR)))
1.9 +#define DWORD_PTR DWORD
1.10 +#endif
1.11 +#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
1.12 +#define LONG_PTR LONG
1.13 +#endif
1.14 +#ifndef GWLP_HINSTANCE
1.15 +#define GWLP_HINSTANCE GWL_HINSTANCE
1.16 +#endif
1.17 +#endif
1.18 #else /* !__GNUC__ && !_MSC_VER */
1.19 typedef signed char int8_t;
1.20 typedef unsigned char uint8_t;
2.1 --- a/src/video/SDL_blit_A.c Sat Jun 16 05:51:51 2007 +0000
2.2 +++ b/src/video/SDL_blit_A.c Thu Jun 21 18:20:59 2007 +0000
2.3 @@ -24,14 +24,30 @@
2.4 #include "SDL_video.h"
2.5 #include "SDL_blit.h"
2.6
2.7 +/*
2.8 + In Visual C, VC6 has mmintrin.h in the "Processor Pack" add-on.
2.9 + Checking if _mm_free is #defined in malloc.h is is the only way to
2.10 + determine if the Processor Pack is installed, as far as I can tell.
2.11 +*/
2.12 +
2.13 #if SDL_ASSEMBLY_ROUTINES
2.14 -#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
2.15 -#define MMX_ASMBLIT 1
2.16 -#define GCC_ASMBLIT 1
2.17 -#elif defined(_MSC_VER) && (_MSC_VER >= 1200) && defined(_M_IX86)
2.18 -#define MMX_ASMBLIT 1
2.19 -#define MSVC_ASMBLIT 1
2.20 -#endif
2.21 +# if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
2.22 +# define MMX_ASMBLIT 1
2.23 +# define GCC_ASMBLIT 1
2.24 +# elif defined(_MSC_VER) && defined(_M_IX86)
2.25 +# if (_MSC_VER <= 1200)
2.26 +# include <malloc.h>
2.27 +# if defined(_mm_free)
2.28 +# define HAVE_MMINTRIN_H 1
2.29 +# endif
2.30 +# else /* Visual Studio > VC6 always has mmintrin.h */
2.31 +# define HAVE_MMINTRIN_H 1
2.32 +# endif
2.33 +# if HAVE_MMINTRIN_H
2.34 +# define MMX_ASMBLIT 1
2.35 +# define MSVC_ASMBLIT 1
2.36 +# endif
2.37 +# endif
2.38 #endif /* SDL_ASSEMBLY_ROUTINES */
2.39
2.40 /* Function to check the CPU flags */