Diff for /gforth/libcc.fs between versions 1.60 and 1.61

version 1.60, 2009/10/17 20:57:33 version 1.61, 2009/10/18 17:52:50
Line 251  variable c-prefix-lines-end c-prefix-lin Line 251  variable c-prefix-lines-end c-prefix-lin
 : print-c-prefix-lines ( -- )  : print-c-prefix-lines ( -- )
     c-prefix-lines @ ['] print-c-prefix-line list-map ;      c-prefix-lines @ ['] print-c-prefix-line list-map ;
   
 : free-c-prefix-lines ( -- )  : write-c-prefix-line ( c-addr u -- )
     c-prefix-lines @ off  c-prefix-lines @ c-prefix-lines-end ! ;      c-source-file-id @ dup if
           write-line throw
       else
           drop 2drop
       then ;
   
 : save-c-prefix-line ( c-addr u -- )  : save-c-prefix-line1 ( c-addr u -- )
     c-source-file-id @ ?dup-if      2dup write-c-prefix-line
         >r 2dup r> write-line throw  
     then  
     align here 0 , c-prefix-lines-end list-append ( c-addr u )      align here 0 , c-prefix-lines-end list-append ( c-addr u )
     longstring, ;      longstring, ;
   
   defer save-c-prefix-line ( c-addr u -- )
   ' save-c-prefix-line1 is save-c-prefix-line
   
 : \c ( "rest-of-line" -- ) \ gforth backslash-c  : \c ( "rest-of-line" -- ) \ gforth backslash-c
     \G One line of C declarations for the C interface      \G One line of C declarations for the C interface
     -1 parse save-c-prefix-line ;      -1 parse save-c-prefix-line ;
Line 489  create gen-wrapped-types Line 494  create gen-wrapped-types
     assert( c-source-file-id @ 0= )      assert( c-source-file-id @ 0= )
     { d: filename }      { d: filename }
     here 0 , lib-handle-addr ! filename lib-filename 2!      here 0 , lib-handle-addr ! filename lib-filename 2!
     filename basename lib-modulename 2! ;      filename basename lib-modulename 2!
       ['] write-c-prefix-line is save-c-prefix-line ;
         
 : c-library-name-create ( -- )  : c-library-name-create ( -- )
     lib-filename 2@ s" .c" s+ 2dup w/o create-file throw      lib-filename 2@ s" .c" s+ 2dup w/o create-file throw
     dup c-source-file-id !      c-source-file-id !
     ['] print-c-prefix-lines swap outfile-execute      drop free throw ;
     drop free-c-prefix-lines free throw ;  
   
 : c-named-library-name ( c-addr u -- )  : c-named-library-name ( c-addr u -- )
     \ set up filenames for a (possibly new) library; c-addr u is the      \ set up filenames for a (possibly new) library; c-addr u is the
Line 506  create gen-wrapped-types Line 511  create gen-wrapped-types
     else      else
         libcc-named-dir $1ff mkdir-parents drop          libcc-named-dir $1ff mkdir-parents drop
         drop c-library-name-create          drop c-library-name-create
           c-prefix-lines @ ['] print-c-prefix-line \ first line only
           c-source-file-id @ outfile-execute
     endif ;      endif ;
   
 : c-tmp-library-name ( c-addr u -- )  : c-tmp-library-name ( c-addr u -- )
     \ set up filenames for a new library; c-addr u is the basename of      \ set up filenames for a new library; c-addr u is the basename of
     \ the library      \ the library
     libcc-tmp-dir 2dup $1ff mkdir-parents drop      libcc-tmp-dir 2dup $1ff mkdir-parents drop
     prepend-dirname c-library-name-setup c-library-name-create ;      prepend-dirname c-library-name-setup c-library-name-create
       ['] print-c-prefix-lines c-source-file-id @ outfile-execute ;
   
 : lib-handle ( -- addr )  : lib-handle ( -- addr )
     lib-handle-addr @ @ ;      lib-handle-addr @ @ ;
Line 638  clear-libs Line 646  clear-libs
   
 : end-c-library ( -- ) \ gforth  : end-c-library ( -- ) \ gforth
 \G Finish and (if necessary) build the latest C library interface.  \G Finish and (if necessary) build the latest C library interface.
       ['] save-c-prefix-line1 is save-c-prefix-line
     ['] compile-wrapper-function1 is compile-wrapper-function      ['] compile-wrapper-function1 is compile-wrapper-function
     compile-wrapper-function1 ;      compile-wrapper-function1 ;
   

Removed from v.1.60  
changed lines
  Added in v.1.61


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