From 59456a731fe4cad83ddcabc10f43522bb73bb86b Mon Sep 17 00:00:00 2001 From: sof Date: Wed, 3 Mar 1999 19:00:07 +0000 Subject: [PATCH] [project @ 1999-03-03 19:00:07 by sof] mingw32 tweaks --- ghc/rts/Itimer.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/ghc/rts/Itimer.c b/ghc/rts/Itimer.c index d40ab4e..5ec8c0d 100644 --- a/ghc/rts/Itimer.c +++ b/ghc/rts/Itimer.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Itimer.c,v 1.3 1999/02/05 16:02:44 simonm Exp $ + * $Id: Itimer.c,v 1.4 1999/03/03 19:00:07 sof Exp $ * * (c) The GHC Team, 1995-1999 * @@ -36,6 +36,10 @@ # include # endif # endif + +#if HAVE_WINDOWS_H +# include +#endif /* * Handling timer events under cygwin32 is not done with signal/setitimer. @@ -48,20 +52,17 @@ * 11/98: if the cygwin DLL supports setitimer(), then use it instead. */ -#if defined(cygwin32_TARGET_OS) && !defined(HAVE_SETITIMER) - -#include /* OK, bring it all in... */ +#if defined(mingw32_TARGET_OS) || (defined(cygwin32_TARGET_OS) && !defined(HAVE_SETITIMER)) /* - vtalrm_handler is assigned and set up in - main/Signals.lc. + vtalrm_handler is assigned and set up in Signals.c - vtalrm_id (defined in main/Signals.lc) holds + vtalrm_id (defined in Signals.c) holds the system id for the current timer (used to - later block/kill the timer) + later block/kill it.) */ extern nat vtalrm_id; -extern TIMECALLBACK *vtalrm_cback; +TIMECALLBACK *vtalrm_cback; nat initialize_virtual_timer(nat ms) @@ -129,6 +130,15 @@ initialize_virtual_timer(nat ms) } # endif +#if defined(mingw32_TARGET_OS) || (defined(cygwin32_TARGET_OS) && !defined(HAVE_SETITIMER)) +int +install_vtalrm_handler(void (*handler)(int)) +{ + vtalrm_cback = handler; + return 0; +} + +#else int install_vtalrm_handler(void (*handler)(int)) { @@ -163,3 +173,4 @@ unblock_vtalrm_signal(void) (void) sigprocmask(SIG_UNBLOCK, &signals, NULL); } +#endif -- 1.7.10.4