[project @ 1999-03-02 20:14:00 by sof]
authorsof <unknown>
Tue, 2 Mar 1999 20:14:02 +0000 (20:14 +0000)
committersof <unknown>
Tue, 2 Mar 1999 20:14:02 +0000 (20:14 +0000)
mingw32 tweaks

ghc/lib/std/cbits/Makefile
ghc/lib/std/cbits/progargs.c
ghc/lib/std/cbits/timezone.h

index f963344..662ac40 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.2 1998/12/02 13:27:12 simonm Exp $
+# $Id: Makefile,v 1.3 1999/03/02 20:14:00 sof Exp $
 
 TOP = ../../..
 include $(TOP)/mk/boilerplate.mk
@@ -13,6 +13,7 @@ C_OBJS  = $(C_SRCS:.c=.o)
 LIBOBJS = $(C_OBJS)
 SRC_CC_OPTS += -O -I$(GHC_INCLUDE_DIR) $(GhcLibCcOpts)
 
+
 #
 # Compile the files using the Haskell compiler (ghc really).
 # 
index d4aaf27..c4519d6 100644 (file)
@@ -1,7 +1,7 @@
 /* 
  * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
  *
- * $Id: progargs.c,v 1.1 1998/12/09 17:09:50 sof Exp $
+ * $Id: progargs.c,v 1.2 1999/03/02 20:14:01 sof Exp $
  *
  * System.getArgs Runtime Support
  */
@@ -9,8 +9,8 @@
 #include "Rts.h"
 #include "stgio.h"
 
-extern char** prog_argv;
-extern int prog_argc;
+DLLIMPORT extern char** prog_argv;
+DLLIMPORT extern int prog_argc;
 
 StgAddr
 get_prog_argv(void)
index 4df0a87..1473812 100644 (file)
@@ -1,7 +1,7 @@
 /* 
  * (c) The GRASP/AQUA Project, Glasgow University, 1994-1998
  *
- * $Id: timezone.h,v 1.6 1999/02/09 09:43:08 simonm Exp $
+ * $Id: timezone.h,v 1.7 1999/03/02 20:14:02 sof Exp $
  *
  * Time-zone support header
  */
 #define GMTOFF(x)        (((struct tm *)x)->tm_gmtoff)
 #else /* ! HAVE_TM_ZONE */
 # if HAVE_TZNAME || cygwin32_TARGET_OS
-#if cygwin32_TARGET_OS
-#define tzname _tzname
-#endif
+#  if cygwin32_TARGET_OS
+#   define tzname _tzname
+#  endif
+#  ifndef mingw32_TARGET_OS
 extern char *tzname[2];
+#  endif
+
 #  define ZONE(x)       (((struct tm *)x)->tm_isdst ? tzname[1] : tzname[0])
 #  define SETZONE(x,z)
 # else /* ! HAVE_TZNAME */
@@ -72,16 +75,24 @@ extern char *tzname[2];
 # endif /* ! HAVE_TZNAME */
 /* Get the offset in secs from UTC, if (struct tm) doesn't supply it. */
 
+#ifdef mingw32_TARGET_OS
+#define timezone _timezone
+#else
+# ifdef cygwin32_TARGET_OS
+#  define timezone _timezone
+# endif
+#endif
+
 #ifndef HAVE_TIMEZONE
 extern TYPE_TIMEZONE timezone;
 #endif
 
 # if HAVE_ALTZONE
 extern time_t altzone;
-#  define GMTOFF(x)     (((struct tm *)x)->tm_isdst ? altzone : timezone)
+#  define GMTOFF(x)     (((struct tm *)x)->tm_isdst ? altzone : timezone )
 # else /* ! HAVE_ALTZONE */
 /* Assume that DST offset is 1 hour ... */
-#  define GMTOFF(x) (((struct tm *)x)->tm_isdst ? (timezone - 3600) : timezone)
+#  define GMTOFF(x) (((struct tm *)x)->tm_isdst ? (timezone - 3600) : timezone )
 # endif /* ! HAVE_ALTZONE */
 #endif  /* ! HAVE_TM_ZONE */