The following patches are for ghc/interpreter, and fix some problems due
to the recent change in Weak/Foreign stuff.

--Jeff

In ghc/includes:

*** Assembler.h 1998/12/07 21:33:20     1.1
--- Assembler.h 1998/12/07 21:33:47
***************
*** 118,123 ****
--- 118,124 ----
    PTR_REP      = 'P',
    ALPHA_REP    = 'a',  /* a                        */
    BETA_REP     = 'b',  /* b                      */
+   GAMMA_REP    = 'c',  /* c                      */
    BOOL_REP     = 'B',  /* Bool                           */
    IO_REP       = 'i',  /* IO a                           */
    HANDLER_REP  = 'H',  /* Exception -> IO a      */

In ghc/interpreter:

===================================================================
RCS file: RCS/type.c,v
retrieving revision 1.1
diff -c -r1.1 type.c
*** type.c      1998/12/08 17:28:42     1.1
--- type.c      1998/12/08 17:30:23
***************
*** 2347,2352 ****
--- 2347,2353 ----
  static Type stateVar = NIL;
  static Type alphaVar = NIL;
  static Type betaVar  = NIL;
+ static Type gammaVar = NIL;
  static Int  nextVar  = 0;

  static Void clearTyVars( void )
***************
*** 2381,2386 ****
--- 2382,2395 ----
      return betaVar;
  }

+ static Type mkGammaVar( void )
+ {
+     if (isNull(gammaVar)) {
+         gammaVar = mkOffset(nextVar++);
+     }
+     return gammaVar;
+ }
+
  static Type local basicType(k)
  Char k; {
      switch (k) {
***************
*** 2445,2450 ****
--- 2454,2461 ----
              return mkAlphaVar();  /* polymorphic */
      case BETA_REP:
              return mkBetaVar();   /* polymorphic */
+     case GAMMA_REP:
+             return mkGammaVar();  /* polymorphic */
      default:
              printf("Kind: '%c'\n",k);
              internal("basicType");

In ghc/lib/std:

*** PrelHandle.lhs      1998/12/07 22:11:22     1.1
--- PrelHandle.lhs      1998/12/08 17:45:51
***************
*** 47,58 ****
  #define CCALL(fun) _ccall_ fun
  #define const_BUFSIZ ``BUFSIZ''
  #define primPackString
  #ifndef __PARALLEL_HASKELL__
  #define FILE_OBJECT       ForeignObj
  #else
  #define FILE_OBJECT       Addr
  #endif
- #endif

  \end{code}

--- 47,59 ----
  #define CCALL(fun) _ccall_ fun
  #define const_BUFSIZ ``BUFSIZ''
  #define primPackString
+ #endif
+
  #ifndef __PARALLEL_HASKELL__
  #define FILE_OBJECT       ForeignObj
  #else
  #define FILE_OBJECT       Addr
  #endif

  \end{code}

***************
*** 151,158 ****
  freeFileObject :: ForeignObj -> IO ()
  freeFileObject fo = CCALL(freeFileObject) fo
  #else
! foreign import stdcall "./libHS_cbits.dll" "freeStdFileObject"
freeStdFileObject :: ForeignObj -> IO ()
! foreign import stdcall "./libHS_cbits.dll" "freeFileObject"
freeFileObject :: ForeignObj -> IO ()
  #endif
  \end{code}

--- 152,159 ----
  freeFileObject :: ForeignObj -> IO ()
  freeFileObject fo = CCALL(freeFileObject) fo
  #else
! foreign import stdcall "libHS_cbits.so" "freeStdFileObject"
freeStdFileObject :: ForeignObj -> IO ()
! foreign import stdcall "libHS_cbits.so" "freeFileObject"
freeFileObject :: ForeignObj -> IO ()
  #endif
  \end{code}



Reply via email to