[project @ 2003-08-19 16:39:13 by simonmar]
[haskell-directory.git] / include / HsBase.h
index a917b96..51f2e60 100644 (file)
@@ -1,14 +1,14 @@
 /* -----------------------------------------------------------------------------
- * $Id: HsBase.h,v 1.15 2002/10/03 12:43:50 panne Exp $
+ * $Id: HsBase.h,v 1.23 2003/08/19 16:39:14 simonmar 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"
@@ -78,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)
@@ -114,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
    -------------------------------------------------------------------------- */
@@ -374,10 +384,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
@@ -386,10 +396,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);
 
 }
 
@@ -620,7 +630,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; }
@@ -632,7 +644,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__ */