patch from kipples for ffi struct args (fixes issue #330)

This commit is contained in:
Alex Shinn 2016-05-18 22:36:59 +09:00
parent 25a8e4f11a
commit cccfe33f7f
2 changed files with 2 additions and 3 deletions

View file

@ -284,8 +284,7 @@ double circle_area2(struct Circle circ) {
((struct Point) center circle-center) ((struct Point) center circle-center)
(double radius circle-radius)) (double radius circle-radius))
(define-c double circle_area1 (Circle)) (define-c double circle_area1 (Circle))
;; TODO: struct means no pointer (define-c double circle_area2 ((struct Circle)))
;;(define-c double circle_area2 ((struct Circle)))
(define-c-type Color predicate: color?) (define-c-type Color predicate: color?)
(define-c void set_color (short short short (result pointer Color))) (define-c void set_color (short short short (result pointer Color)))
(define-c Color make_color (short short short)) (define-c Color make_color (short short short))

View file

@ -764,7 +764,7 @@
(void*? (void-pointer-type? type))) (void*? (void-pointer-type? type)))
(cond (cond
((or ctype void*?) ((or ctype void*?)
(cat (if (type-reference? type) "*" "") (cat (if (or (type-struct? type) (type-reference? type)) "*" "")
"(" (type-c-name type) ")" "(" (type-c-name type) ")"
(if (type-null? type) (if (type-null? type)
"sexp_cpointer_maybe_null_value" "sexp_cpointer_maybe_null_value"