Skip to content

Commit

Permalink
Check for set_lossage_handler
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-s committed Jun 27, 2024
1 parent d68c862 commit 06475ea
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/bindings.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@
(format stream " initialized = 1;~%")
;; Set the lossage handler to a function that longjmps out of the
;; most recent call-into-Lisp
(format stream " set_lossage_handler(return_from_lisp);~%")
(when (sb-sys:find-foreign-symbol-address "set_lossage_handler")
(format stream " set_lossage_handler(return_from_lisp);~%"))
(format stream " return 0; }"))

(defun build-bindings (library directory &key (omit-init-function nil)
Expand Down Expand Up @@ -133,7 +134,8 @@
(format stream "__thread jmp_buf fatal_lisp_error_handler;~%~%")
#+win32
(format stream "__thread intptr_t fatal_lisp_error_handler[5];~%~%")
(format stream "void set_lossage_handler(void (*handler)(void));~%")
(when (sb-sys:find-foreign-symbol-address "set_lossage_handler")
(format stream "void set_lossage_handler(void (*handler)(void));~%"))
(format stream "void ldb_monitor(void);~%~%")
(format stream "int fatal_sbcl_error_occurred = 0;~%~%")
(format stream "void return_from_lisp(void) { fatal_sbcl_error_occurred = 1; fflush(stdout); fflush(stderr); ~a(fatal_lisp_error_handler, 1); }~%~%"
Expand Down

0 comments on commit 06475ea

Please sign in to comment.