Permalink
Browse files

Older versions of SBCL had a function SB-EXT:QUIT instead of SB-EXT:E…

…XIT.

This fix checks whether SB-EXT:EXIT exists, and if not, will fall back to
the older way of doing it.
  • Loading branch information...
1 parent 13f132e commit 04870161c4130a1d971e99ee5bd0d46526e7d551 Elias Martenson committed Sep 4, 2012
Showing with 12 additions and 1 deletion.
  1. +12 −1 dev/sbcl.lisp
View
@@ -86,5 +86,16 @@
(defun %get-env-var (name)
(sb-ext:posix-getenv name))
+(defun symbol-if-external (name package)
+ (multiple-value-bind (symbol s) (find-symbol name package)
+ (when (eq s :external)
+ symbol)))
+
(defun %exit (code)
- (sb-ext:exit :code code))
+ (let ((exit-sym (symbol-if-external "EXIT" "SB-EXT")))
+ (if exit-sym
+ (funcall exit-sym :code code)
+ (let ((quit-sym (symbol-if-external "QUIT" "SB-EXT")))
+ (if quit-sym
+ (funcall quit-sym :code code :recklessly-p t)
+ (error "SBCL version without EXIT or QUIT."))))))

0 comments on commit 0487016

Please sign in to comment.