diff options
author | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2014-09-14 14:53:09 -0500 |
---|---|---|
committer | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2014-09-14 15:06:00 -0500 |
commit | e4489f1db288b6377fcded22a29e470f83c6665f (patch) | |
tree | e1e13d92b6917407a339159120757ce267d55730 /contrib/gregbook | |
parent | 3fe1616c4525ed2e50d84228fc69ac59c4efaa75 (diff) | |
download | libpng-e4489f1db288b6377fcded22a29e470f83c6665f.tar.gz |
[libpng16] Only define usleep() in gregbook/rpng2-x.c if not already defined.
Diffstat (limited to 'contrib/gregbook')
-rw-r--r-- | contrib/gregbook/rpng2-x.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/contrib/gregbook/rpng2-x.c b/contrib/gregbook/rpng2-x.c index a146ef417..6e02c890d 100644 --- a/contrib/gregbook/rpng2-x.c +++ b/contrib/gregbook/rpng2-x.c @@ -103,9 +103,6 @@ #define RESNAME "rpng2" /* our X resource application name */ #define RESCLASS "Rpng" /* our X resource class name */ -/* This is temporary until the code is rewritten to use nanosleep(). */ -#define usleep(x) sleep(((x)+499999)/1000000) - #include <stdio.h> #include <stdlib.h> #include <ctype.h> @@ -118,6 +115,11 @@ #include <X11/Xos.h> #include <X11/keysym.h> /* defines XK_* macros */ +/* This is temporary until the code is rewritten to use nanosleep(). */ +#ifndef usleep +# define usleep(x) sleep(((x)+499999)/1000000) +#endif + #ifdef VMS # include <unistd.h> #endif |