projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7409d87
)
[project @ 2001-08-15 09:23:25 by rrt]
author
rrt
<unknown>
Wed, 15 Aug 2001 09:23:25 +0000
(09:23 +0000)
committer
rrt
<unknown>
Wed, 15 Aug 2001 09:23:25 +0000
(09:23 +0000)
Fake argc & argv
ghc/lib/std/cbits/ilxstubs.c
patch
|
blob
|
history
diff --git
a/ghc/lib/std/cbits/ilxstubs.c
b/ghc/lib/std/cbits/ilxstubs.c
index
1a3e473
..
d1f64ba
100644
(file)
--- a/
ghc/lib/std/cbits/ilxstubs.c
+++ b/
ghc/lib/std/cbits/ilxstubs.c
@@
-1,7
+1,7
@@
/*
* (c) The GHC Team 2001
*
/*
* (c) The GHC Team 2001
*
- * $Id: ilxstubs.c,v 1.2 2001/07/16 09:23:24 rrt Exp $
+ * $Id: ilxstubs.c,v 1.3 2001/08/15 09:23:25 rrt Exp $
*
* ILX stubs for external function calls
*/
*
* ILX stubs for external function calls
*/
@@
-29,14
+29,27
@@
/* StgPrimFloat Add to mini-RTS, which is put in a DLL */
/* Need to be implemented in ILX RTS */
/* StgPrimFloat Add to mini-RTS, which is put in a DLL */
/* Need to be implemented in ILX RTS */
- /*foreign label "prog_argv" prog_argv_label :: Ptr (Ptr (Ptr CChar))
-foreign label "prog_argc" prog_argc_label :: Ptr CInt
-foreign label "ErrorHdrHook" errorHdrHook :: Ptr ()
-../PrelStable.lhs:37:foreign import unsafe freeStablePtr :: StablePtr a -> IO ()
+/*../PrelStable.lhs:37:foreign import unsafe freeStablePtr :: StablePtr a -> IO ()
../PrelTopHandler.lhs:49:foreign import ccall "shutdownHaskellAndExit"
../PrelTopHandler.lhs:77:foreign import ccall "stackOverflow" unsafe
../PrelTopHandler.lhs:80:foreign import ccall "stg_exit" unsafe */
../PrelTopHandler.lhs:49:foreign import ccall "shutdownHaskellAndExit"
../PrelTopHandler.lhs:77:foreign import ccall "stackOverflow" unsafe
../PrelTopHandler.lhs:80:foreign import ccall "stg_exit" unsafe */
+/* Fake this for now, as a DLL can't refer to main() */
+int argc = 0;
+char **argv = NULL;
+
+int
+prog_argc_addr(void)
+{
+ return &argc;
+}
+
+char ***
+prog_argv_addr(void)
+{
+ return &argv;
+}
+
void
stg_exit(I_ n)
{
void
stg_exit(I_ n)
{