Diff for /gforth/prim between versions 1.227 and 1.234

version 1.227, 2008/05/05 13:37:20 version 1.234, 2008/08/16 17:54:23
Line 1 Line 1
 \ Gforth primitives  \ Gforth primitives
   
 \ Copyright (C) 1995,1996,1997,1998,2000,2003,2004,2005,2006,2007 Free Software Foundation, Inc.  \ Copyright (C) 1995,1996,1997,1998,2000,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc.
   
 \ This file is part of Gforth.  \ This file is part of Gforth.
   
Line 1674  supported on your machine (take a look a Line 1674  supported on your machine (take a look a
 your machine has a separate instruction cache. In such cases,  your machine has a separate instruction cache. In such cases,
 @code{flush-icache} does nothing instead of flushing the instruction  @code{flush-icache} does nothing instead of flushing the instruction
 cache.""  cache.""
 FLUSH_ICACHE(c_addr,u);  FLUSH_ICACHE((caddr_t)c_addr,u);
   
 (bye)   ( n -- )        gforth  paren_bye  (bye)   ( n -- )        gforth  paren_bye
 SUPER_END;  SUPER_END;
Line 1777  access the stack itself. The stack point Line 1777  access the stack itself. The stack point
 variables @code{gforth_SP} and @code{gforth_FP}.""  variables @code{gforth_SP} and @code{gforth_FP}.""
 /* This is a first attempt at support for calls to C. This may change in  /* This is a first attempt at support for calls to C. This may change in
    the future */     the future */
   IF_fpTOS(fp[0]=fpTOS);
 gforth_FP=fp;  gforth_FP=fp;
 gforth_SP=sp;  gforth_SP=sp;
   gforth_RP=rp;
   gforth_LP=lp;
 ((void (*)())w)();  ((void (*)())w)();
 sp=gforth_SP;  sp=gforth_SP;
 fp=gforth_FP;  fp=gforth_FP;
   rp=gforth_RP;
   lp=gforth_LP;
   IF_fpTOS(fpTOS=fp[0]);
   
 \+  \+
 \+file  \+file
Line 2393  r = fp[u]; Line 2399  r = fp[u];
 \g syslib  \g syslib
   
 open-lib        ( c_addr1 u1 -- u2 )    gforth  open_lib  open-lib        ( c_addr1 u1 -- u2 )    gforth  open_lib
 #if 1  #ifdef HAVE_LIBLTDL
 u2 = (UCell)lt_dlopen(cstr(c_addr1, u1, 1));  u2 = (UCell)lt_dlopen(tilde_cstr(c_addr1, u1, 1));
 #elif defined(HAVE_LIBDL) || defined(HAVE_DLOPEN)  #elif defined(HAVE_LIBDL) || defined(HAVE_DLOPEN)
 #ifndef RTLD_GLOBAL  #ifndef RTLD_GLOBAL
 #define RTLD_GLOBAL 0  #define RTLD_GLOBAL 0
 #endif  #endif
 u2=(UCell) dlopen(cstr(c_addr1, u1, 1), RTLD_GLOBAL | RTLD_LAZY);  u2=(UCell) dlopen(tilde_cstr(c_addr1, u1, 1), RTLD_GLOBAL | RTLD_LAZY);
 #else  #else
 #  ifdef _WIN32  #  ifdef _WIN32
 u2 = (Cell) GetModuleHandle(cstr(c_addr1, u1, 1));  u2 = (Cell) GetModuleHandle(tilde_cstr(c_addr1, u1, 1));
 #  else  #  else
 #warning Define open-lib!  #warning Define open-lib!
 u2 = 0;  u2 = 0;
Line 2410  u2 = 0; Line 2416  u2 = 0;
 #endif  #endif
   
 lib-sym ( c_addr1 u1 u2 -- u3 ) gforth  lib_sym  lib-sym ( c_addr1 u1 u2 -- u3 ) gforth  lib_sym
 #if 1  #ifdef HAVE_LIBLTDL
 u3 = (UCell) lt_dlsym((lt_dlhandle)u2, cstr(c_addr1, u1, 1));  u3 = (UCell) lt_dlsym((lt_dlhandle)u2, cstr(c_addr1, u1, 1));
 #elif defined(HAVE_LIBDL) || defined(HAVE_DLOPEN)  #elif defined(HAVE_LIBDL) || defined(HAVE_DLOPEN)
 u3 = (UCell) dlsym((void*)u2,cstr(c_addr1, u1, 1));  u3 = (UCell) dlsym((void*)u2,cstr(c_addr1, u1, 1));
Line 2453  l! ( w c_addr -- ) gforth l_store Line 2459  l! ( w c_addr -- ) gforth l_store
 *(Tetrabyte*)(c_addr) = w;  *(Tetrabyte*)(c_addr) = w;
   
 lib-error ( -- c_addr u )       gforth  lib_error  lib-error ( -- c_addr u )       gforth  lib_error
 c_addr = lt_dlerror();  ""Error message for last failed @code{open-lib} or @code{lib-sym}.""
 u = (c_addr == NULL) ? 0 : strlen(c_addr);  #ifdef HAVE_LIBLTDL
   c_addr = (Char *)lt_dlerror();
   u = (c_addr == NULL) ? 0 : strlen((char *)c_addr);
   #else
   c_addr = "libltdl is not configured";
   u = strlen(c_addr);
   #endif
   
 \+  \+
 \g peephole  \g peephole

Removed from v.1.227  
changed lines
  Added in v.1.234


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>