[project @ 2001-02-22 16:10:12 by rrt]
[ghc-hetmet.git] / ghc / lib / std / Time.hsc
index 95d7139..2dd89d0 100644 (file)
@@ -3,7 +3,7 @@
 -- to compile on sparc-solaris.  Blargh.
 
 -- -----------------------------------------------------------------------------
--- $Id: Time.hsc,v 1.7 2001/01/26 16:16:19 rrt Exp $
+-- $Id: Time.hsc,v 1.9 2001/01/30 10:59:04 simonmar Exp $
 --
 -- (c) The University of Glasgow, 1995-2001
 --
@@ -104,12 +104,18 @@ module Time
 # include <time.h>
 #endif
 
-#ifdef HAVE_WINDOWS_H
-#include <windows.h>
+#ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
+#endif
+
+#ifdef HAVE_SYS_TIMEB_H
 #include <sys/timeb.h>
 #endif
 
+#ifdef HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+
 import Ix
 import Locale
        
@@ -346,6 +352,11 @@ gmtoff x    = (#peek struct tm,tm_gmtoff) x
 #  endif
 #  ifndef mingw32_TARGET_OS
 foreign label tzname :: Ptr (Ptr CChar)
+#  else
+foreign import "ghcTimezone" unsafe timezone :: Ptr CLong
+foreign import "ghcTzname" unsafe tzname :: Ptr (Ptr CChar)
+#   def inline long  *ghcTimezone(void) { return &_timezone; }
+#   def inline char **ghcTzname(void) { return _tzname; }
 #  endif
 zone x = do 
   dst <- (#peek struct tm,tm_isdst) x
@@ -625,5 +636,9 @@ foreign import unsafe gettimeofday :: Ptr CTimeVal -> Ptr () -> IO CInt
 
 #if HAVE_FTIME
 type CTimeB = ()
+#ifndef mingw32_TARGET_OS
 foreign import unsafe ftime :: Ptr CTimeB -> IO CInt
+#else
+foreign import unsafe ftime :: Ptr CTimeB -> IO ()
+#endif
 #endif