Fix bug on chicken when pffi-define argument types is empty list
This commit is contained in:
@@ -60,7 +60,10 @@
|
|||||||
(scheme-name (list-ref expr 1))
|
(scheme-name (list-ref expr 1))
|
||||||
(c-name (symbol->string (cadr (list-ref expr 3))))
|
(c-name (symbol->string (cadr (list-ref expr 3))))
|
||||||
(return-type (pffi-type->native-type (cadr (list-ref expr 4))))
|
(return-type (pffi-type->native-type (cadr (list-ref expr 4))))
|
||||||
(argument-types (map pffi-type->native-type (cadr (list-ref expr 5)))))
|
(argument-types (if (null? (cdr (list-ref expr 5)))
|
||||||
|
(list)
|
||||||
|
(map pffi-type->native-type
|
||||||
|
(cadr (list-ref expr 5))))))
|
||||||
(if (null? argument-types)
|
(if (null? argument-types)
|
||||||
`(define ,scheme-name
|
`(define ,scheme-name
|
||||||
(foreign-safe-lambda ,return-type ,c-name))
|
(foreign-safe-lambda ,return-type ,c-name))
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
(pffi-define-library pffi-libc-stdlib '("ffi.h") "ffi" '())
|
|
||||||
|
|
||||||
(define-record-type <pffi-struct>
|
(define-record-type <pffi-struct>
|
||||||
(struct-make c-type size pointer members)
|
(struct-make c-type size pointer members)
|
||||||
pffi-struct?
|
pffi-struct?
|
||||||
|
|||||||
Reference in New Issue
Block a user