Fix bug on chicken when pffi-define argument types is empty list

This commit is contained in:
retropikzel 2025-04-12 11:18:56 +03:00
parent ae7e87105c
commit ded10bc0f1
2 changed files with 4 additions and 3 deletions

View File

@ -60,7 +60,10 @@
(scheme-name (list-ref expr 1))
(c-name (symbol->string (cadr (list-ref expr 3))))
(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)
`(define ,scheme-name
(foreign-safe-lambda ,return-type ,c-name))

View File

@ -1,5 +1,3 @@
(pffi-define-library pffi-libc-stdlib '("ffi.h") "ffi" '())
(define-record-type <pffi-struct>
(struct-make c-type size pointer members)
pffi-struct?