Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Bind (*parse-bare-structs-as-pointers* t) when parsing function defin…

…itions

In parse-args-and-types, foreign-funcall-form,
foreign-funcall-varargs-form, bind 
(*parse-bare-structs-as-pointers* t) 
when parsing function definitions so that if a bare structure is
specified, the expanded form with have :pointer or (:pointer (:struct
foo)) and therefore the type will be correctly recognized.
  • Loading branch information...
commit 71e2e871990af03cedbb861133d3f1c1a5d52466 1 parent 4108e4f
Liam Healy liamh authored

Showing 1 changed file with 5 additions and 2 deletions. Show diff stats Hide diff stats

  1. +5 2 src/functions.lisp
7 src/functions.lisp
@@ -54,7 +54,8 @@
54 54 (defun parse-args-and-types (args)
55 55 "Returns 4 values. Types, canonicalized types, args and return type."
56 56 (let* ((len (length args))
57   - (return-type (if (oddp len) (lastcar args) :void)))
  57 + (return-type (if (oddp len) (lastcar args) :void))
  58 + (*parse-bare-structs-as-pointers* t))
58 59 (loop repeat (floor len 2)
59 60 for (type arg) on args by #'cddr
60 61 collect type into types
@@ -105,6 +106,7 @@
105 106 (multiple-value-bind (types ctypes fargs rettype)
106 107 (parse-args-and-types args)
107 108 (let ((syms (make-gensym-list (length fargs)))
  109 + (*parse-bare-structs-as-pointers* t)
108 110 (fsbvp (fn-call-by-value-p ctypes rettype)))
109 111 (translate-objects
110 112 syms fargs types rettype
@@ -148,7 +150,8 @@
148 150 (multiple-value-bind (varargs-types varargs-ctypes varargs-fargs rettype)
149 151 (parse-args-and-types varargs)
150 152 (let ((fixed-syms (make-gensym-list (length fixed-fargs)))
151   - (varargs-syms (make-gensym-list (length varargs-fargs))))
  153 + (varargs-syms (make-gensym-list (length varargs-fargs)))
  154 + (*parse-bare-structs-as-pointers* t))
152 155 (translate-objects
153 156 (append fixed-syms varargs-syms)
154 157 (append fixed-fargs varargs-fargs)

0 comments on commit 71e2e87

Please sign in to comment.
Something went wrong with that request. Please try again.