[project @ 2000-04-12 09:43:10 by sewardj]
[ghc-hetmet.git] / ghc / interpreter / interface.c
index e2459a9..b70105f 100644 (file)
@@ -7,8 +7,8 @@
  * Hugs version 1.4, December 1997
  *
  * $RCSfile: interface.c,v $
- * $Revision: 1.48 $
- * $Date: 2000/04/07 09:59:36 $
+ * $Revision: 1.53 $
+ * $Date: 2000/04/12 09:43:10 $
  * ------------------------------------------------------------------------*/
 
 #include "hugsbasictypes.h"
@@ -2543,7 +2543,7 @@ Type type; {
       Sym(int2Integerzh_fast)        \
       Sym(stg_gc_unbx_r1)            \
       Sym(ErrorHdrHook)              \
-      Sym(makeForeignObjzh_fast)     \
+      Sym(mkForeignObjzh_fast)       \
       Sym(__encodeDouble)            \
       Sym(decodeDoublezh_fast)       \
       Sym(isDoubleNaN)               \
@@ -2609,7 +2609,6 @@ Type type; {
       SymX(lseek)                    \
       SymX(write)                    \
       Sym(getrusage)                 \
-      Sym(gettimeofday)              \
       SymX(realloc)                  \
       SymX(getcwd)                   \
       SymX(free)                     \
@@ -2626,7 +2625,7 @@ Type type; {
       SymX(chdir)                    \
       SymX(execl)                    \
       Sym(waitpid)                   \
-      SymX(getenv)
+      SymX(getenv)                   \
 
 #define EXTERN_SYMS_cygwin32         \
       SymX(GetCurrentProcess)        \
@@ -2657,7 +2656,13 @@ Type type; {
       Sym(pow)                       \
       Sym(__errno)                   \
       Sym(stat)                      \
-      Sym(fstat)
+      Sym(fstat)                     \
+      Sym(gettimeofday)              \
+      SymX(localtime)                \
+      SymX(strftime)                 \
+      SymX(mktime)                   \
+      SymX(gmtime)
+
 
 #define EXTERN_SYMS_linux            \
       Sym(__errno_location)          \
@@ -2675,7 +2680,11 @@ Type type; {
       SymX(mktime)                   \
       SymX(gmtime)                   \
       Sym(setitimer)                 \
+      Sym(chmod)                     \
+      Sym(gettimeofday)              \
 
+#define EXTERN_SYMS_solaris2         \
+      SymX(gettimeofday)             \
 
 
 #if defined(linux_TARGET_OS)
@@ -2716,7 +2725,6 @@ OSym rtsTab[]
 #undef SymX
 
 
-void init_stack;
 
 
 /* A kludge to assist Win32 debugging. */
@@ -2764,30 +2772,34 @@ void* lookupObjName ( char* nm )
       t = unZcodeThenFindText(nm2+first_real_char+7);
       if (t == findText("PrelGHC")) return (4+NULL); /* kludge */
       m = findModule(t);
-      if (isNull(m)) goto not_found;
+      if (isNull(m)) goto dire_straits;
       a = lookupOTabName ( m, nm );
       if (a) return a;
-      goto not_found;
+      goto dire_straits;
    }
 
    /* if not an RTS name, look in the 
       relevant module's object symbol table
    */
    pp = strchr(nm2+first_real_char, '_');
-   if (!pp || !isupper(nm2[first_real_char])) goto not_found;
+   if (!pp || !isupper(nm2[first_real_char])) goto dire_straits;
    *pp = 0;
    t = unZcodeThenFindText(nm2+first_real_char);
    m = findModule(t);
-   if (isNull(m)) goto not_found;
+   if (isNull(m)) goto dire_straits;
 
    a = lookupOTabName ( m, nm );  /* RATIONALISE */
    if (a) return a;
 
-  not_found:
+  dire_straits:
+   /* make a desperate, last-ditch attempt to find it */
+   a = lookupOTabNameAbsolutelyEverywhere ( nm );
+   if (a) return a;
+
    fprintf ( stderr, 
              "lookupObjName: can't resolve name `%s'\n", 
              nm );
-   assert(4-4);
+   assert(0);
    return NULL;
 }