1 /* -----------------------------------------------------------------------------
2 * $Id: Stg.h,v 1.7 1999/03/02 19:44:17 sof Exp $
4 * (c) The GHC Team, 1998-1999
6 * Top-level include file for everything STG-ish.
8 * This file is included *automatically* by all .hc files.
10 * ---------------------------------------------------------------------------*/
15 #ifndef NON_POSIX_SOURCE
21 #ifdef __HUGS__ /* vile hack till the GHC folks come on board */
25 /* ToDo: Set this flag properly: COMPILER and INTERPRETER should not be mutually exclusive. */
30 /* This is a feature test - doesn't belong here. FixMe. */
32 #define HAVE_WIN32_DLL_SUPPORT
35 #ifdef HAVE_WIN32_DLL_SUPPORT
36 # if __GNUC__ && !defined(__declspec)
39 # define DLLIMPORT __declspec(dllimport)
40 # define DLLIMPORT_DATA(x) _imp__##x
47 #define DLL_IMPORT DLLIMPORT
48 #define DLL_IMPORT_RTS
49 #define DLL_IMPORT_DATA
50 #define DLL_IMPORT_DATA_VAR(x) x
53 #define DLL_IMPORT_RTS DLLIMPORT
54 #define DLL_IMPORT_DATA DLLIMPORT
55 #define DLL_IMPORT_DATA_VAR(x) _imp__##x
60 #define BITS_PER_BYTE 8
61 #define BITS_IN(x) (BITS_PER_BYTE * sizeof(x))
63 /* -----------------------------------------------------------------------------
64 Assertions and Debuggery
65 -------------------------------------------------------------------------- */
68 #define ASSERT(predicate) /* nothing */
71 void _stgAssert (char *, unsigned int);
73 #define ASSERT(predicate) \
77 _stgAssert(__FILE__, __LINE__)
80 /* -----------------------------------------------------------------------------
81 Include everything STG-ish
82 -------------------------------------------------------------------------- */
84 /* Global type definitions*/
87 /* Global constaints */
88 #include "Constants.h"
90 /* Profiling information */
91 #include "Profiling.h"
93 /* Storage format definitions */
95 #include "InfoTables.h"
98 /* STG/Optimised-C related stuff */
101 #include "TailCalls.h"
104 * Added by Ian McDonald 7/5/98
105 * XXX The position of this code is very
106 * important - it must come after the
109 #ifdef nemesis_TARGET_OS
117 /* these are all ANSI C headers */
136 /* Wired-in Prelude identifiers */
139 /* Storage Manager */
140 #include "StgStorage.h"
142 /* Macros for STG/C code */
143 #include "ClosureMacros.h"
144 #include "InfoMacros.h"
145 #include "StgMacros.h"
149 #include "StgTicky.h"
153 /* Built-in entry points */
154 #include "StgMiscClosures.h"
156 /* Runtime-system hooks */
159 /* Misc stuff without a home */
160 #ifdef BUILDING_RTS_DLL
161 extern DLLIMPORT char **prog_argv; /* so we can get at these from Haskell */
162 extern DLLIMPORT int prog_argc;
164 extern char **prog_argv; /* so we can get at these from Haskell */
165 extern int prog_argc;
168 extern char **environ;
170 /* Creating and destroying an adjustor thunk.
171 I cannot make myself create a separate .h file
174 extern void* createAdjustor(int cconv, StgStablePtr hptr, StgFunPtr wptr);
175 extern void freeHaskellFunctionPtr(void* ptr);