# HG changeset patch # User Ryan C. Gordon # Date 1180859963 0 # Node ID 874162355be56e8e094cb320fa8b5d83b89a3e76 # Parent 21942f552734b00fbb2f985edd58c9e31b9add84 Merged r3037:3038 from branches/SDL-1.2: Mac OS X memcpy/memset selection. diff -r 21942f552734 -r 874162355be5 include/SDL_stdinc.h --- a/include/SDL_stdinc.h Thu May 31 14:46:01 2007 +0000 +++ b/include/SDL_stdinc.h Sun Jun 03 08:39:23 2007 +0000 @@ -279,7 +279,10 @@ #define SDL_zero(x) SDL_memset(&(x), 0, sizeof((x))) #define SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x))) -#if defined(__GNUC__) && defined(i386) +/* We can count on memset existing on Mac OS X and being well-tuned. */ +#if defined(__MACH__) && defined(__APPLE__) +#define SDL_memset4(dst, val, len) memset(dst, val, (len)*4) +#elif defined(__GNUC__) && defined(i386) #define SDL_memset4(dst, val, len) \ do { \ int u0, u1, u2; \ @@ -308,7 +311,10 @@ } while(0) #endif -#if defined(__GNUC__) && defined(i386) +/* We can count on memcpy existing on Mac OS X and being well-tuned. */ +#if defined(__MACH__) && defined(__APPLE__) +#define SDL_memcpy(dst, src, len) memcpy(dst, src, len) +#elif defined(__GNUC__) && defined(i386) #define SDL_memcpy(dst, src, len) \ do { \ int u0, u1, u2; \ @@ -338,7 +344,10 @@ #endif #endif -#if defined(__GNUC__) && defined(i386) +/* We can count on memcpy existing on Mac OS X and being well-tuned. */ +#if defined(__MACH__) && defined(__APPLE__) +#define SDL_memcpy4(dst, src, len) memcpy(dst, src, (len)*4) +#elif defined(__GNUC__) && defined(i386) #define SDL_memcpy4(dst, src, len) \ do { \ int ecx, edi, esi; \