[project @ 2003-08-20 15:54:45 by panne]
[ghc-base.git] / include / HsBase.h
index cc64b4a..e5be148 100644 (file)
@@ -1,14 +1,14 @@
 /* -----------------------------------------------------------------------------
- * $Id: HsBase.h,v 1.14 2002/09/25 15:24:07 simonmar Exp $
+ * $Id: HsBase.h,v 1.24 2003/08/20 15:54:45 panne Exp $
  *
  * (c) The University of Glasgow 2001-2002
  *
- * Definitions for package `core' which are visible in Haskell land.
+ * Definitions for package `base' which are visible in Haskell land.
  *
  * ---------------------------------------------------------------------------*/
 
-#ifndef HSCORE_H
-#define HSCORE_H
+#ifndef __HSBASE_H__
+#define __HSBASE_H__
 
 #include "config.h"
 #include "HsFFI.h"
@@ -47,6 +47,9 @@
 #ifdef HAVE_UTIME_H
 #include <utime.h>
 #endif
+#ifdef HAVE_SYS_UTSNAME_H
+#include <sys/utsname.h>
+#endif
 #if defined(HAVE_GETTIMEOFDAY)
 #  ifdef HAVE_SYS_TIME_H
 #   include <sys/time.h>
@@ -75,6 +78,9 @@
 #ifdef HAVE_LIMITS_H
 #include <limits.h>
 #endif
+#ifdef HAVE_WCTYPE_H
+#include <wctype.h>
+#endif
 
 #if !defined(mingw32_TARGET_OS) && !defined(irix_TARGET_OS)
 # if defined(HAVE_SYS_RESOURCE_H)
@@ -111,11 +117,18 @@ int *ghcErrno(void);
 HsInt systemCmd(HsAddr cmd);
 
 /* in rawSystem.c */
-HsInt rawSystemCmd(HsAddr cmd);
+#if defined(mingw32_TARGET_OS)
+HsInt rawSystem(HsAddr cmd);
+#else
+HsInt rawSystem(HsAddr cmd, HsAddr args);
+#endif
 
 /* in inputReady.c */
 int inputReady(int fd, int msecs, int isSock);
 
+/* in writeError.c */
+void writeErrString__(HsAddr msg_hdr, HsAddr msg, HsInt len);
+
 /* -----------------------------------------------------------------------------
    64-bit operations, defined in longlong.c
    -------------------------------------------------------------------------- */
@@ -246,11 +259,7 @@ __hscore_seek_cur()
 INLINE HsInt
 __hscore_o_binary()
 {
-#ifdef HAVE_O_BINARY
-  return O_BINARY;
-#else
-  return 0;
-#endif
+  return CONST_O_BINARY;
 }
 
 INLINE int
@@ -371,10 +380,10 @@ __hscore_PrelHandle_write( HsInt fd, HsBool isSock, HsAddr ptr,
 {
 #if defined(__MINGW32__)
   if (isSock) {
-    return send(fd,ptr + off, sz, 0);
+    return send(fd,(char *)ptr + off, sz, 0);
   }
 #endif
-  return write(fd,ptr + off, sz);
+  return write(fd,(char *)ptr + off, sz);
 }
 
 INLINE HsInt
@@ -383,10 +392,10 @@ __hscore_PrelHandle_read( HsInt fd, HsBool isSock, HsAddr ptr,
 {
 #if defined(__MINGW32__)
   if (isSock) {
-    return recv(fd,ptr + off, sz, 0);
+    return recv(fd,(char *)ptr + off, sz, 0);
   }
 #endif
-  return read(fd,ptr + off, sz);
+  return read(fd,(char *)ptr + off, sz);
 
 }
 
@@ -617,7 +626,9 @@ INLINE int __hsposix_SIGTTIN()   { return SIGTTIN; }
 INLINE int __hsposix_SIGTTOU()   { return SIGTTOU; }
 INLINE int __hsposix_SIGUSR1()   { return SIGUSR1; }
 INLINE int __hsposix_SIGUSR2()   { return SIGUSR2; }
+#if HAVE_SIGPOLL
 INLINE int __hsposix_SIGPOLL()   { return SIGPOLL; }
+#endif
 INLINE int __hsposix_SIGPROF()   { return SIGPROF; }
 INLINE int __hsposix_SIGSYS()    { return SIGSYS; }
 INLINE int __hsposix_SIGTRAP()   { return SIGTRAP; }
@@ -629,7 +640,7 @@ INLINE int __hsposix_SIGXFSZ()   { return SIGXFSZ; }
 INLINE int __hsposix_SIG_BLOCK()   { return SIG_BLOCK; }
 INLINE int __hsposix_SIG_UNBLOCK() { return SIG_SETMASK; }
 INLINE int __hsposix_SIG_SETMASK() { return SIG_UNBLOCK; }
-#endif // mingw32_TARGET_OS
+#endif /* mingw32_TARGET_OS */
 
-#endif
+#endif /* __HSBASE_H__ */