diff include/SDL_stdinc.h @ 2111:874162355be5

Merged r3037:3038 from branches/SDL-1.2: Mac OS X memcpy/memset selection.
author Ryan C. Gordon <icculus@icculus.org>
date Sun, 03 Jun 2007 08:39:23 +0000
parents 8bfba7ec379a
children 0313af081a84
line wrap: on
line diff
--- 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;					\