include/SDL_stdinc.h
changeset 2157 75a6c5deba84
parent 2143 e906da4414a3
child 2279 65bb3dd0b350
equal deleted inserted replaced
2156:cd041eb7eb4a 2157:75a6c5deba84
   277 extern DECLSPEC void *SDLCALL SDL_memset(void *dst, int c, size_t len);
   277 extern DECLSPEC void *SDLCALL SDL_memset(void *dst, int c, size_t len);
   278 #endif
   278 #endif
   279 #define SDL_zero(x)	SDL_memset(&(x), 0, sizeof((x)))
   279 #define SDL_zero(x)	SDL_memset(&(x), 0, sizeof((x)))
   280 #define SDL_zerop(x)	SDL_memset((x), 0, sizeof(*(x)))
   280 #define SDL_zerop(x)	SDL_memset((x), 0, sizeof(*(x)))
   281 
   281 
   282 /* We can count on memset existing on Mac OS X and being well-tuned. */
   282 #if defined(__GNUC__) && defined(i386)
   283 #if defined(__MACH__) && defined(__APPLE__)
       
   284 #define SDL_memset4(dst, val, len) memset(dst, val, (len)*4)
       
   285 #elif defined(__GNUC__) && defined(i386)
       
   286 #define SDL_memset4(dst, val, len)				\
   283 #define SDL_memset4(dst, val, len)				\
   287 do {								\
   284 do {								\
   288 	int u0, u1, u2;						\
   285 	int u0, u1, u2;						\
   289 	__asm__ __volatile__ (					\
   286 	__asm__ __volatile__ (					\
   290 		"cld\n\t"					\
   287 		"cld\n\t"					\