Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Merged r3094:3095 from branches/SDL-1.2: Visual C++ 6.0 fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jun 21, 2007
1 parent 645bee0 commit 4b0dcf1
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 7 deletions.
10 changes: 10 additions & 0 deletions include/SDL_config_win32.h
Expand Up @@ -45,6 +45,16 @@ typedef unsigned __int64 uintptr_t;
typedef unsigned int uintptr_t;
#endif
#define _UINTPTR_T_DEFINED
/* Older Visual C++ headers don't have the Win64-compatible typedefs... */
#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR)))
#define DWORD_PTR DWORD
#endif
#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
#define LONG_PTR LONG
#endif
#ifndef GWLP_HINSTANCE
#define GWLP_HINSTANCE GWL_HINSTANCE
#endif
#endif
#else /* !__GNUC__ && !_MSC_VER */
typedef signed char int8_t;
Expand Down
30 changes: 23 additions & 7 deletions src/video/SDL_blit_A.c
Expand Up @@ -24,14 +24,30 @@
#include "SDL_video.h"
#include "SDL_blit.h"

/*
In Visual C, VC6 has mmintrin.h in the "Processor Pack" add-on.
Checking if _mm_free is #defined in malloc.h is is the only way to
determine if the Processor Pack is installed, as far as I can tell.
*/

#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)
#define MMX_ASMBLIT 1
#define MSVC_ASMBLIT 1
#endif
# if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
# define MMX_ASMBLIT 1
# define GCC_ASMBLIT 1
# elif defined(_MSC_VER) && defined(_M_IX86)
# if (_MSC_VER <= 1200)
# include <malloc.h>
# if defined(_mm_free)
# define HAVE_MMINTRIN_H 1
# endif
# else /* Visual Studio > VC6 always has mmintrin.h */
# define HAVE_MMINTRIN_H 1
# endif
# if HAVE_MMINTRIN_H
# define MMX_ASMBLIT 1
# define MSVC_ASMBLIT 1
# endif
# endif
#endif /* SDL_ASSEMBLY_ROUTINES */

/* Function to check the CPU flags */
Expand Down

0 comments on commit 4b0dcf1

Please sign in to comment.