Merged r3037:3038 from branches/SDL-1.2: Mac OS X memcpy/memset selection.
authorRyan C. Gordon <icculus@icculus.org>
Sun, 03 Jun 2007 08:39:23 +0000
changeset 2111 874162355be5
parent 2110 21942f552734
child 2112 024af473e643
Merged r3037:3038 from branches/SDL-1.2: Mac OS X memcpy/memset selection.
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;					\