Last active
April 15, 2018 01:13
-
-
Save cbaggers/caeba24cdc9ceff164feadcc876b25c9 to your computer and use it in GitHub Desktop.
kill cl-sdl2 on sbcl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#+sbcl | |
(eval-when (:compile-toplevel :load-toplevel :execute) | |
(sb-int:set-floating-point-modes :traps nil)) | |
(defpackage :moo (:use :cl :sdl2)) | |
(in-package :moo) | |
(defun print! (x &rest args) | |
(format t "~%~a~{ ~s~}" x args) | |
(finish-output) | |
x) | |
(defun death () | |
(print! "hi") | |
(print! "about to init") | |
(sdl2::check-rc | |
(sdl2-ffi.functions:sdl-init | |
(autowrap:mask-apply 'sdl2::sdl-init-flags '(:everything)))) | |
;;(sdl2:create-window) | |
(print! "was init" (sdl2:was-init :everything)) | |
(unwind-protect | |
(progn | |
(print! "next will poll a single event a bunch of times") | |
(loop :for i :below 300 :do | |
(sdl2::sdl-pump-events)) | |
(print! "event poll'd")) | |
(print! "about to quit") | |
(print "quit:" (sdl2::sdl-quit)) | |
(print! "successfully quit"))) | |
;; - `(ql:quickload :sdl2)` | |
;; - compile this file | |
;; - `(moo::death)` | |
;; - dies with 'Process inferior-lisp segmentation fault: 11' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Strange, the
(sb-int:set-floating-point-modes :traps nil)
is not executed when compiling with C-c C-k.If executed in the REPL, it works. With
(sdl2:create-window)
uncommented.