Mercurial > sdl-ios-xcode
comparison src/timer/linux/SDL_systimer.c @ 1156:8521404a33c7
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
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Tue, 11 Oct 2005 17:33:03 +0000 |
parents | b8d311d90021 |
children | baf35853ad54 |
comparison
equal
deleted
inserted
replaced
1155:91569ec25acd | 1156:8521404a33c7 |
---|---|
53 | 53 |
54 #if defined(linux) | 54 #if defined(linux) |
55 /* Linux select() changes its timeout parameter upon return to contain | 55 /* Linux select() changes its timeout parameter upon return to contain |
56 the remaining time. Most other unixen leave it unchanged or undefined. */ | 56 the remaining time. Most other unixen leave it unchanged or undefined. */ |
57 #define SELECT_SETS_REMAINING | 57 #define SELECT_SETS_REMAINING |
58 #elif defined(__bsdi__) || defined(__FreeBSD__) || defined(__sun) | 58 #elif defined(__bsdi__) || defined(__FreeBSD__) || defined(__sun) || defined(MACOSX) |
59 #define USE_NANOSLEEP | 59 #define USE_NANOSLEEP |
60 #endif | 60 #endif |
61 | 61 |
62 #if defined(i386) || defined(__i386__) | 62 #if defined(i386) || defined(__i386__) |
63 /* This only works on pentium or newer x86 processors */ | 63 /* This only works on pentium or newer x86 processors */ |