1 /* -----------------------------------------------------------------------------
2 * $Id: Stg.h,v 1.5 1999/01/26 11:12:57 simonm Exp $
4 * Top-level include file for everything STG-ish.
6 * This file is included *automatically* by all .hc files.
8 * ---------------------------------------------------------------------------*/
13 #ifndef NON_POSIX_SOURCE
19 #ifdef __HUGS__ /* vile hack till the GHC folks come on board */
23 /* ToDo: Set this flag properly: COMPILER and INTERPRETER should not be mutually exclusive. */
30 #define BITS_PER_BYTE 8
31 #define BITS_IN(x) (BITS_PER_BYTE * sizeof(x))
33 /* -----------------------------------------------------------------------------
34 Assertions and Debuggery
35 -------------------------------------------------------------------------- */
38 #define ASSERT(predicate) /* nothing */
41 void _stgAssert (char *, unsigned int);
43 #define ASSERT(predicate) \
47 _stgAssert(__FILE__, __LINE__)
50 /* -----------------------------------------------------------------------------
51 Include everything STG-ish
52 -------------------------------------------------------------------------- */
54 /* Global type definitions*/
57 /* Global constaints */
58 #include "Constants.h"
60 /* Profiling information */
61 #include "Profiling.h"
63 /* Storage format definitions */
65 #include "InfoTables.h"
68 /* STG/Optimised-C related stuff */
71 #include "TailCalls.h"
74 * Added by Ian McDonald 7/5/98
75 * XXX The position of this code is very
76 * important - it must come after the
79 #ifdef nemesis_TARGET_OS
87 /* these are all ANSI C headers */
106 /* Wired-in Prelude identifiers */
109 /* Storage Manager */
110 #include "StgStorage.h"
112 /* Macros for STG/C code */
113 #include "ClosureMacros.h"
114 #include "InfoMacros.h"
115 #include "StgMacros.h"
119 #include "StgTicky.h"
123 /* Built-in entry points */
124 #include "StgMiscClosures.h"
126 /* Runtime-system hooks */
129 /* Misc stuff without a home */
130 extern char **prog_argv; /* so we can get at these from Haskell */
131 extern int prog_argc;
133 extern char **environ;
135 /* Creating and destroying an adjustor thunk.
136 I cannot make myself create a separate .h file
139 extern void* createAdjustor(int cconv, StgStablePtr hptr, StgFunPtr wptr);
140 extern void freeHaskellFunctionPtr(void* ptr);