Paste number 18654: patch to get slime wirking on win32

Paste number 18654: patch to get slime wirking on win32
Pasted by: tritchey
When:8 years, 7 months ago
Share:Tweet this! | http://paste.lisp.org/+EE6
Channel:#lisp
Paste contents:
Raw Source | XML | Display As
? .slime
? swank-sbcl-win32.patch
Index: swank-sbcl.lisp
===================================================================
RCS file: /project/slime/cvsroot/slime/swank-sbcl.lisp,v
retrieving revision 1.152
diff -u -r1.152 swank-sbcl.lisp
--- swank-sbcl.lisp	20 Jan 2006 21:31:20 -0000	1.152
+++ swank-sbcl.lisp	15 Mar 2006 02:50:16 -0000
@@ -16,7 +16,7 @@
 (eval-when (:compile-toplevel :load-toplevel :execute)
   (require 'sb-bsd-sockets)
   (require 'sb-introspect)
-  (require 'sb-posix))
+  #-win32 (require 'sb-posix))
 
 (declaim (optimize (debug 2)))
 
@@ -62,24 +62,28 @@
                                       (external-format :iso-latin-1-unix)
                                       (buffering :full))
   (make-socket-io-stream (accept socket) external-format buffering))
-
+#-win32
 (defvar *sigio-handlers* '()
   "List of (key . fn) pairs to be called on SIGIO.")
 
+#-win32
 (defun sigio-handler (signal code scp)
   (declare (ignore signal code scp))
   (mapc (lambda (handler)
           (funcall (the function (cdr handler))))
         *sigio-handlers*))
 
+#-win32
 (defun set-sigio-handler ()
   (sb-sys:enable-interrupt sb-unix:sigio (lambda (signal code scp)
                                            (sigio-handler signal code scp))))
 
+#-win32
 (defun enable-sigio-on-fd (fd)
   (sb-posix::fcntl fd sb-posix::f-setfl sb-posix::o-async)
   (sb-posix::fcntl fd sb-posix::f-setown (getpid)))
 
+#-win32
 (defimplementation add-sigio-handler (socket fn)
   (set-sigio-handler)
   (let ((fd (socket-fd socket)))
@@ -87,6 +91,7 @@
     (enable-sigio-on-fd fd)
     (push (cons fd fn) *sigio-handlers*)))
 
+#-win32
 (defimplementation remove-sigio-handlers (socket)
   (let ((fd (socket-fd socket)))
     (setf *sigio-handlers* (delete fd *sigio-handlers* :key #'car))
@@ -138,7 +143,10 @@
   (sb-sys:without-interrupts (funcall fn)))
 
 (defimplementation getpid ()
-  (sb-posix:getpid))
+  #-win32
+  (sb-posix:getpid)
+  #+win32
+  0)
 
 (defimplementation lisp-implementation-type-name ()
   "sbcl")

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.