Changeset 31455 in project for release/5


Ignore:
Timestamp:
09/19/14 09:58:39 (4 years ago)
Author:
felix
Message:

updated bind to use exported compiler API, dependencies are not ported yet

Location:
release/5/bind/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • release/5/bind/trunk/bind-translator.scm

    r28996 r31455  
    1616                         set-bind-options set-renaming
    1717                         no-c-syntax-checks
     18                         test-debug-flag
    1819                         ;; export default foreign-transfomer:
    1920                         bind-foreign-lambda*)
     
    5960(define foreign-transformer bind-foreign-lambda*)
    6061
     62;; unless this is running in the compiler, create stubs for some API procedures
    6163(unless (or (memq #:compiling ##sys#features) (memq #:compiler-extension ##sys#features))
    62   (set! ##compiler#foreign-type-table (make-vector 301 '())) )
     64  (set! chicken.compiler.support#register-foreign-type! void)
     65  (set! chicken.compiler.support#lookup-foreign-type void)
     66  (set! chicken.compiler.support#debugging-chicken '()))
     67
     68(define (test-debug-flag sym)
     69  (memq sym chicken.compiler.support#debugging-chicken))
    6370
    6471(define (parsing-error arg1 . more)
     
    8087  (let ((iparts 0))
    8188    (let rec ((scope 0))
    82       (let ([chunks '()]
    83             (cdebug (memq 'X ##compiler#debugging-chicken)))
     89      (let ((chunks '())
     90            (cdebug (test-debug-flag 'X)))
    8491        (let loop ((mode #f) (tokens '()))
    8592          (match-let (((t . ln) (lexer)))
     
    139146
    140147(define (parse c)
    141   (when (memq 'C ##compiler#debugging-chicken)
     148  (when (test-debug-flag 'C)
    142149    (pp `(CHUNK: ,c) (current-error-port)) )
    143150  (match c
     
    191198                (if fname
    192199                    (begin
    193                       (when (memq 'F ##compiler#debugging-chicken)
     200                      (when (test-debug-flag 'F)
    194201                        (fprintf (current-error-port) "parsing ~a ...~%" fname) )
    195202                      (call-with-input-file fname parse-easy-ffi-rec) )
     
    798805
    799806(define (emit x)
    800   (let ((dbg (memq 'F ##compiler#debugging-chicken)))
     807  (let ((dbg (test-debug-flag 'F)))
    801808    (when dbg (pp (strip-syntax x) (current-error-port)))
    802809    (set! processed-output (cons x processed-output) ) ) )
     
    11031110       (let ([stname (->symbol tname)] )
    11041111         (set! declared-types (cons stname declared-types))
    1105          (##sys#hash-table-set!
    1106           ##compiler#foreign-type-table stname stype) ; will be overwritten later
     1112         (chicken.compiler.support#register-foreign-type! stname stype) ; will be overwritten later
    11071113         `(,(r 'begin)
    11081114           (,(r 'foreign-declare)
     
    11601166      [(void) (str "void")]
    11611167      [else
    1162        (cond [(and (symbol? type) (##sys#hash-table-ref ##compiler#foreign-type-table type))
     1168       (cond [(and (symbol? type)
     1169                   (chicken.compiler.support#lookup-foreign-type type))
    11631170              => (lambda (t)
    11641171                   (foreign-type-declaration (if (vector? t) (vector-ref t 0) t) target)) ]
     
    13131320      (('template . _) '<pointer>)
    13141321      [(? symbol?)
    1315        (let ([a (##sys#hash-table-ref ##compiler#foreign-type-table ftype)])
     1322       (let ([a (chicken.compiler.support#lookup-foreign-type ftype)])
    13161323         (if a
    13171324             (rec (if (vector? a) (vector-ref a 0) a))
  • release/5/bind/trunk/bind.setup

    r29857 r31455  
    44(use make)
    55
    6 (define version "1.5.2")
     6(define version "1.5.3")
    77
    88(make (("c.l.scm" ("c.l")
  • release/5/bind/trunk/chicken-bind.scm

    r22574 r31455  
    11;;;; chicken-bind.scm - Standalone wrapper generator
    22
    3 
    4 (define ##compiler#debugging-chicken '())
    53
    64(require-extension srfi-1 utils bind-translator extras regex)
     
    3836              (rest (cdr args)))
    3937          (cond ((string=? "-debug" arg)
    40                  (set! ##compiler#debugging-chicken '(C X))
     38                 (set! chicken.compiler.support#debugging-chicken '(C X))
    4139                 (loop rest))
    4240                ((string=? "-export-constants" arg)
Note: See TracChangeset for help on using the changeset viewer.