Would someone who knows how to _sleep, and knows about autoconf, like to
decide what (if anything) needs doing here?

Simon

-----Original Message-----
From: Claus Reinke [mailto:[EMAIL PROTECTED] 
Sent: 21 November 2005 10:16
To: Simon Peyton-Jones
Subject: Re: mingw, head, use of sleep in utils/prof/cgprof/main.c?

>thanks for looking into this Claus.  If there is something that we
>should change in GHC, let us know.  (Ideally give a patch!)
>
>SImon

I thought I did?  The second reference below points to Wu Yongwei's
sleep.h, of which only the "defined(_NEED_SLEEP_ONLY)"-branch is 
needed here (defining sleep as Sleep or _sleep, with a factor of 1000, 
when under windows, as I mentioned).

I simply used something like this directly in main.c to get my build
going:

#if defined(__MINGW32__)
#include <stdlib.h>
#define sleep(t) _sleep((t) * 1000)
#endif

but later read that Sleep might be preferred over _sleep, and thought
that our autoconf-gurus would want to place such things in a more
central place, anyway, depending on configure tests, given that 
everyone else's windows builds still seem to work - hence my 
description of the issues instead of a patch..

claus

| -----Original Message-----
| From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Claus Reinke
| Sent: 18 November 2005 21:11
| To: [EMAIL PROTECTED]
| Subject: mingw, head, use of sleep in utils/prof/cgprof/main.c?
| 
| while trying to update my copy of cvs head (mingw/cygwin/winxp),
| configure complained about needing a newer ld, so I updated my
| mingw installation. the build is running along now, but I ran into
| a problem with old code in utils/prof/cgprof/main.c, which uses
| "sleep", which doesn't really seem to exist under windows.
| 
| mingw provides _sleep (stdlib.h) and Sleep (winbase.h), and the
| former seems deprecated, according to comments. compare
| 
| http://sourceforge.net/mailarchive/message.php?msg_id=1013788
| http://sourceforge.net/mailarchive/message.php?msg_id=11321871
| 
| (the workaround seems to be to define sleep as Sleep or _sleep,
|  with a factor of 1000, when under windows).
| 
| the issue seems an old one, so I don't know why this ever compiled
| (perhaps mingw implicitly linked sleep to _sleep, and dropped that
| support in newer versions?)?
| 
| cheers,
| claus
| 
| _______________________________________________
| Cvs-ghc mailing list
| [EMAIL PROTECTED]
| http://www.haskell.org/mailman/listinfo/cvs-ghc

_______________________________________________
Cvs-ghc mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to