1 /* -----------------------------------------------------------------------------
2 * $Id: Stg.h,v 1.6 1999/02/05 16:02:28 simonm 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. */
32 #define BITS_PER_BYTE 8
33 #define BITS_IN(x) (BITS_PER_BYTE * sizeof(x))
35 /* -----------------------------------------------------------------------------
36 Assertions and Debuggery
37 -------------------------------------------------------------------------- */
40 #define ASSERT(predicate) /* nothing */
43 void _stgAssert (char *, unsigned int);
45 #define ASSERT(predicate) \
49 _stgAssert(__FILE__, __LINE__)
52 /* -----------------------------------------------------------------------------
53 Include everything STG-ish
54 -------------------------------------------------------------------------- */
56 /* Global type definitions*/
59 /* Global constaints */
60 #include "Constants.h"
62 /* Profiling information */
63 #include "Profiling.h"
65 /* Storage format definitions */
67 #include "InfoTables.h"
70 /* STG/Optimised-C related stuff */
73 #include "TailCalls.h"
76 * Added by Ian McDonald 7/5/98
77 * XXX The position of this code is very
78 * important - it must come after the
81 #ifdef nemesis_TARGET_OS
89 /* these are all ANSI C headers */
108 /* Wired-in Prelude identifiers */
111 /* Storage Manager */
112 #include "StgStorage.h"
114 /* Macros for STG/C code */
115 #include "ClosureMacros.h"
116 #include "InfoMacros.h"
117 #include "StgMacros.h"
121 #include "StgTicky.h"
125 /* Built-in entry points */
126 #include "StgMiscClosures.h"
128 /* Runtime-system hooks */
131 /* Misc stuff without a home */
132 extern char **prog_argv; /* so we can get at these from Haskell */
133 extern int prog_argc;
135 extern char **environ;
137 /* Creating and destroying an adjustor thunk.
138 I cannot make myself create a separate .h file
141 extern void* createAdjustor(int cconv, StgStablePtr hptr, StgFunPtr wptr);
142 extern void freeHaskellFunctionPtr(void* ptr);