Date: Tue, 11 Oct 2005 16:58:12 +0300 (EEST)
authorRyan C. Gordon
Tue, 11 Oct 2005 17:33:03 +0000
changeset 11568521404a33c7
parent 1155 91569ec25acd
child 1157 baf35853ad54
Date: Tue, 11 Oct 2005 16:58:12 +0300 (EEST)
From: =?ISO-8859-1?Q?Martin_Storsj=F6?= <martin@martin.st>
To: sdl@libsdl.org
Subject: [SDL] [PATCH] Use nanosleep on OS X

Hi,

The current version of SDL_Delay on OS X seems to always sleep at least 10
msec. OS X has nanosleep(), which performs shorter sleeps well. The
attached patch makes it use that one instead of select() as currently.

// Martin
src/timer/linux/SDL_systimer.c
     1.1 --- a/src/timer/linux/SDL_systimer.c	Mon Oct 03 08:38:28 2005 +0000
     1.2 +++ b/src/timer/linux/SDL_systimer.c	Tue Oct 11 17:33:03 2005 +0000
     1.3 @@ -55,7 +55,7 @@
     1.4  /* Linux select() changes its timeout parameter upon return to contain
     1.5     the remaining time. Most other unixen leave it unchanged or undefined. */
     1.6  #define SELECT_SETS_REMAINING
     1.7 -#elif defined(__bsdi__) || defined(__FreeBSD__) || defined(__sun)
     1.8 +#elif defined(__bsdi__) || defined(__FreeBSD__) || defined(__sun) || defined(MACOSX)
     1.9  #define USE_NANOSLEEP
    1.10  #endif
    1.11