[SDL] SDL-1.2.10 Win32 Build error: mmintrin.h
Ken Rogoway
Ken at HomebrewSoftware.com
Fri Jun 2 11:00:37 PDT 2006
Alex Volkov <avcp-sdlmail <at> usa.net> writes:
>
> Sam Lantinga wrote:
> > Is there any way to explicitly check for the processor pack?
> > Maybe some #define somewhere?
>
> Alex Volkov wrote:
> > There appears to be none.
>
> Actually, I looked *very* hard, and there does appear to be a way. It's a
> hack, but the kind that should not get invalidated by future VC6 versions
> (since VC6 is at almost the end of its life).
> The guards should be something like this:
>
> #elif defined(_MSC_VER) && (_MSC_VER >= 1200) && defined(_M_IX86)
> /* Dirty hack -- VC6 Processor Pack installs malloc.h that
> * defines _mm_malloc. Luckily, we only need this trick for VC6,
> * and it looks like VC6 will not change anymore */
> #include <malloc.h>
> #if (_MSC_VER >= 1300) || defined(_mm_malloc)
> #define MMX_ASMBLIT 1
> #define MSVC_ASMBLIT 1
> #endif
> #endif
>
> Ken, please test this with your VC6 and VC7 versions if you can. Thank you!
>
> -Alex.
I tested it and it works for both VC6 and VC7. The actual block in
SDL_blit_A.c is:
#if SDL_ASSEMBLY_ROUTINES
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
#define MMX_ASMBLIT 1
#define GCC_ASMBLIT 1
#elif defined(_MSC_VER) && (_MSC_VER >= 1200) && defined(_M_IX86)
/* Dirty hack -- VC6 Processor Pack installs malloc.h that
* defines _mm_malloc. Luckily, we only need this trick for VC6,
* and it looks like VC6 will not change anymore */
#include <malloc.h>
#if (_MSC_VER >= 1300) || defined(_mm_malloc)
#define MMX_ASMBLIT 1
#define MSVC_ASMBLIT 1
#endif
#endif
#endif /* SDL_ASSEMBLY_ROUTINES */
I have another issue when compiling dibaudio.c:
c:\code\sdl-1.2.10\src\audio\windib\sdl_dibaudio.c(101) : error C2146: syntax
error : missing ')' before identifier 'dwInstance'
c:\code\sdl-1.2.10\src\audio\windib\sdl_dibaudio.c(101) : error
C2081: 'DWORD_PTR' : name in formal parameter list illegal
This is referring to:
/* The Win32 callback for filling the WAVE device */
static void CALLBACK FillSound(HWAVEOUT hwo, UINT uMsg, DWORD_PTR dwInstance,
DWORD dwParam1, DWORD dwParam2)
{
This only happens when compiling with VC6.
More information about the SDL
mailing list