chiark / gitweb /
Bug fix (function name included in declarations)
[clg] / gffi / interface.lisp
index 0df9387e8d6025c0c231a0bcd4d91a0378abb792..6b249a3feeb10a3442d7b7f876975f14fdcc5ca3 100644 (file)
@@ -20,7 +20,7 @@
 ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-;; $Id: interface.lisp,v 1.7 2007-10-17 17:04:15 espen Exp $
+;; $Id: interface.lisp,v 1.9 2008-10-08 16:34:07 espen Exp $
 
 (in-package "GFFI")
 
 
 (in-package "GFFI")
 
@@ -128,8 +128,15 @@ (defmacro defbinding (name lambda-list return-type &rest args)
                     (list 
                      (cond 
                       ((and (namep expr) (not (in-arg-p style))) expr)
                     (list 
                      (cond 
                       ((and (namep expr) (not (in-arg-p style))) expr)
-                      ((namep expr) (make-symbol (string expr)))
-                      ((gensym)))
+                      ((namep expr)                    
+                       #-clisp(make-symbol (string expr))
+                       ;; The above used to work in CLISP, but I'm
+                       ;; not sure exactly at which version it
+                       ;; broke. The following could potentially
+                       ;; cause variable capturing
+                       #+clisp(intern (format nil "~A-~A" (string expr) (gensym))))
+                      (#-clisp(gensym)
+                       #+clisp(intern (string (gensym)))))
                      (or aux expr) type style out-type))))
             args)))
   
                      (or aux expr) type style out-type))))
             args)))
   
@@ -209,7 +216,8 @@ (defun %defbinding (cname lisp-name lambda-list declare-p arg-types aux-bindings
                     when (out-arg-p style)
                     collect (return-type out-type)
                     when (return-arg-p style)
                     when (out-arg-p style)
                     collect (return-type out-type)
                     when (return-arg-p style)
-                    collect (return-type type)))))))
+                    collect (return-type type))))
+               ,lisp-name)))
          (defun ,lisp-name ,lambda-list
          ,doc
          (let ,aux-bindings
          (defun ,lisp-name ,lambda-list
          ,doc
          (let ,aux-bindings