Added define-stubless-foreign.
This commit is contained in:
parent
c96cde2294
commit
56d5597025
19
cig/cig.scm
19
cig/cig.scm
|
@ -863,6 +863,10 @@ step 4
|
||||||
(let ((name (cdr form)))
|
(let ((name (cdr form)))
|
||||||
(set! init-name (car name))))
|
(set! init-name (car name))))
|
||||||
|
|
||||||
|
((define-stubless-foreign)
|
||||||
|
(let ((c-name (cadddr form)))
|
||||||
|
(set! c-names (cons c-name c-names))))
|
||||||
|
|
||||||
((foreign-source)
|
((foreign-source)
|
||||||
(let ((forms (cdr form)))
|
(let ((forms (cdr form)))
|
||||||
(if (pair? forms)
|
(if (pair? forms)
|
||||||
|
@ -1089,9 +1093,11 @@ step 4
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(define-structure define-foreign-syntax (export (define-foreign :syntax)
|
(define-structure define-foreign-syntax
|
||||||
(foreign-source :syntax)
|
(export (define-foreign :syntax)
|
||||||
(foreign-init-name :syntax))
|
(foreign-source :syntax)
|
||||||
|
(foreign-init-name :syntax)
|
||||||
|
(define-stubless-foreign :syntax))
|
||||||
(open scheme external-calls structure-refs cig-aux)
|
(open scheme external-calls structure-refs cig-aux)
|
||||||
(access signals) ; for ERROR
|
(access signals) ; for ERROR
|
||||||
(for-syntax (open scheme define-foreign-syntax-support))
|
(for-syntax (open scheme define-foreign-syntax-support))
|
||||||
|
@ -1108,7 +1114,12 @@ step 4
|
||||||
(define-syntax foreign-init-name
|
(define-syntax foreign-init-name
|
||||||
(syntax-rules ()
|
(syntax-rules ()
|
||||||
((foreign-init-name name) (lambda () name))))
|
((foreign-init-name name) (lambda () name))))
|
||||||
|
|
||||||
|
(define-syntax define-stubless-foreign
|
||||||
|
(syntax-rules ()
|
||||||
|
((define-stubless-foreign bla ...)
|
||||||
|
(import-lambda-definition bla ...))))
|
||||||
|
|
||||||
(define (check-arg pred obj proc)
|
(define (check-arg pred obj proc)
|
||||||
(if (not (pred obj))
|
(if (not (pred obj))
|
||||||
(error "check-arg" pred obj proc)
|
(error "check-arg" pred obj proc)
|
||||||
|
|
Loading…
Reference in New Issue