*
* API for invoking Haskell functions via the RTS
*
+ * To understand the structure of the RTS headers, see the wiki:
+ * http://hackage.haskell.org/trac/ghc/wiki/Commentary/SourceTree/Includes
+ *
* --------------------------------------------------------------------------*/
#ifndef RTSAPI_H
HeapExhausted /* out of memory */
} SchedulerStatus;
-typedef StgClosure *HaskellObj;
+typedef struct StgClosure_ *HaskellObj;
/*
* An abstract type representing the token returned by rts_lock() and
extern void setProgArgv ( int argc, char *argv[] );
extern void getFullProgArgv ( int *argc, char **argv[] );
extern void setFullProgArgv ( int argc, char *argv[] );
+extern void freeFullProgArgv ( void ) ;
#ifndef mingw32_HOST_OS
extern void shutdownHaskellAndSignal (int sig);
These are used by foreign export and foreign import "wrapper" stubs.
----------------------------------------------------------------------- */
+// When producing Windows DLLs the we need to know which symbols are in the
+// local package/DLL vs external ones.
+//
+// Note that RtsAPI.h is also included by foreign export stubs in
+// the base package itself.
+//
+#if defined(mingw32_TARGET_OS) && defined(__PIC__) && !defined(COMPILING_BASE_PACKAGE)
+__declspec(dllimport) extern StgWord base_GHCziTopHandler_runIO_closure[];
+__declspec(dllimport) extern StgWord base_GHCziTopHandler_runNonIO_closure[];
+#else
extern StgWord base_GHCziTopHandler_runIO_closure[];
extern StgWord base_GHCziTopHandler_runNonIO_closure[];
-#define runIO_closure base_GHCziTopHandler_runIO_closure
-#define runNonIO_closure base_GHCziTopHandler_runNonIO_closure
+#endif
+
+#define runIO_closure base_GHCziTopHandler_runIO_closure
+#define runNonIO_closure base_GHCziTopHandler_runNonIO_closure
/* ------------------------------------------------------------------------ */