Skip to content

Commit

Permalink
Fixup lifting
Browse files Browse the repository at this point in the history
  • Loading branch information
Singh committed Sep 13, 2024
1 parent 3ee1103 commit e6243b8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/python-bindings.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
(format nil
"~a = ~a.~a
~a.restype = ~a
~a.argtypes = [~{~a~^, ~}]"
~a.argtypes = [~{~a~^, ~}]
~:[~;~a = sbcl_librarian.wrapper.lift_fn(\"~:*~a\", ~:*~a)~%~]"
;; First line
(coerce-to-c-name callable-name)
library-name
Expand All @@ -26,9 +27,10 @@
(loop :for (name type) :in typed-lambda-list
:collect (python-type type))
(and result-type
(list (format nil "POINTER(~a)" (python-type result-type))))))
(when (eql 'error-type return-type)
(format nil "~a = sbcl_librarian.wrapper.lift_fn(\"~@*~a\", ~@*~a)~%" (coerce-to-c-name callable-name)))))
(list (format nil "POINTER(~a)" (python-type result-type)))))
;; Fourth line (optional)
(eql 'error-type return-type)
(coerce-to-c-name callable-name))))

(defun write-default-python-header (library stream &optional (omit-init-call nil)
(library-path nil))
Expand Down

0 comments on commit e6243b8

Please sign in to comment.