Skip to content

Commit

Permalink
Enable the debugger on SBCL and move around some functions
Browse files Browse the repository at this point in the history
  • Loading branch information
sdilts committed Sep 10, 2024
1 parent 386e54c commit e2c327d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
8 changes: 1 addition & 7 deletions lisp/main.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@
(xkb:keysym-get-name (mahogany/keyboard::key-keysym key)))))
(handle-key-event key seat)))))

(defun disable-fpu-exceptions ()
#+sbcl
(sb-int:set-floating-point-modes :traps nil)
#+ccl
(set-fpu-mode :overflow nil))

(defmacro init-callback-struct (variable type &body sets)
(let ((vars (mapcar #'car sets)))
`(cffi:with-foreign-slots (,vars ,variable ,type)
Expand All @@ -38,7 +32,7 @@
(disable-fpu-exceptions)
(hrt:load-foreign-libraries)
(log-init :level :trace)
(sb-ext:enable-debugger)
(enable-debugger)
(cffi:with-foreign-objects ((output-callbacks '(:struct hrt-output-callbacks))
(seat-callbacks '(:struct hrt-seat-callbacks))
(view-callbacks '(:struct hrt-view-callbacks))
Expand Down
13 changes: 12 additions & 1 deletion lisp/util.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
(defpackage #:mahogany/util
(:use #:cl)
(:export #:mahogany-error
#:defglobal))
#:defglobal
#:enable-debugger))

(in-package #:mahogany/util)

Expand All @@ -25,3 +26,13 @@
`(ccl:defstatic ,name ,value ,doc)
#+(not (or ccl sbcl))
`(defvar ,name ,value ,doc))

(defun enable-debugger ()
#+sbcl
(sb-ext:enable-debugger))

(defun disable-fpu-exceptions ()
#+sbcl
(sb-int:set-floating-point-modes :traps nil)
#+ccl
(set-fpu-mode :overflow nil))

0 comments on commit e2c327d

Please sign in to comment.