Skip to content

Commit

Permalink
Add linkage to function pointer declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-s committed Jul 11, 2024
1 parent a96d673 commit e3e0c86
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/bindings.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
:function-prefix (api-function-prefix api)
:error-map (api-error-map api))))))))))

(defun write-api-to-source (api stream)
(defun write-api-to-source (api linkage stream)
(dolist (spec (api-specs api))
(destructuring-bind (kind &rest things) spec
(ecase kind
Expand All @@ -63,6 +63,7 @@
(c-function-declaration name result-type typed-lambda-list
:datap t
:externp nil
:linkage linkage
:function-prefix (api-function-prefix api)
:c-prefix "_"
:error-map (api-error-map api))
Expand Down Expand Up @@ -149,6 +150,6 @@
(format stream "void return_from_lisp(void) { fatal_sbcl_error_occurred = 1; fflush(stdout); fflush(stderr); ~a(JMP_BUF_CAST fatal_lisp_error_handler, 1); }~%~%"
*longjmp-operator*)
(dolist (api (library-apis library))
(write-api-to-source api stream))
(write-api-to-source api linkage stream))
(unless omit-init-function
(write-init-function 'init linkage stream initialize-lisp-args)))))

0 comments on commit e3e0c86

Please sign in to comment.