From e4489f1db288b6377fcded22a29e470f83c6665f Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Sun, 14 Sep 2014 14:53:09 -0500 Subject: [PATCH] [libpng16] Only define usleep() in gregbook/rpng2-x.c if not already defined. --- ANNOUNCE | 2 ++ CHANGES | 2 ++ contrib/gregbook/rpng2-x.c | 8 +++++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 55da1b332..769069eea 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -33,6 +33,8 @@ Version 1.6.14beta01 [September 14, 2014] Add "#include " to contrib/tools/pngfix.c (John Bowler) Version 1.6.14beta02 [September 14, 2014] + Define usleep() in contrib/gregbook/rpng2-x.c if not already defined + in unistd.h; fixes error introduced in libpng-1.6.13. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/CHANGES b/CHANGES index 99b40ccf4..ab508b8ec 100644 --- a/CHANGES +++ b/CHANGES @@ -4986,6 +4986,8 @@ Version 1.6.14beta01 [September 14, 2014] Add "#include " to contrib/tools/pngfix.c (John Bowler) Version 1.6.14beta02 [September 14, 2014] + Define usleep() in contrib/gregbook/rpng2-x.c if not already defined + in unistd.h; fixes error introduced in libpng-1.6.13. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit 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 #include #include @@ -118,6 +115,11 @@ #include #include /* 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 #endif