This is the mail archive of the
mailing list for the Cygwin project.
sleep removed ?
- From: Herbert Groot Jebbink <herbert at groot dot jebbink dot nl>
- To: cygwin at cygwin dot com
- Date: Wed, 11 Jul 2012 10:58:46 +0200
- Subject: sleep removed ?
I was asked to make a little change in a c program from 10+ years ago.
The change itself was not the problem, but the environment is changed
and I did have compile problems.
Old: Cygwin: 1.3.2 (0.39/3/2) 2001-05-20 23:28
New: Cygwin: 1.7.15 (0.260/5/3) 2012-05-09 10:25
The problem was the sleep statement, that was not working anymore:
/home/herbert/project/main.c:124: undefined reference to `_sleep'
Below (the relevant parts of) the old code:
/* Extra defenition for avoiding warning at compiling */
unsigned int sleep(int); /* somehow, compiler don't understand
it completely */
I changed it into:
# include <windows.h>
# define sleep(x) Sleep(1000 * x)
# include <unistd.h>
It compiles now, but is it also correct ?
The executable did go from 251 KB to 1034 KB, is this caused by
windows.h that is now included and not in the old version ?
Kind Regards, Herbert
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple