From 5d3ffab45b1bb78be7f1767e1e439d8f661ab796 Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Thu, 26 Sep 2013 11:40:45 +0300 Subject: [PATCH] windows: fix sb-bsd-sockets build by adding shutdown() support --- contrib/sb-bsd-sockets/win32-constants.lisp | 16 ++++++++++++++++ contrib/sb-bsd-sockets/win32-sockets.lisp | 3 +++ 2 files changed, 19 insertions(+) diff --git a/contrib/sb-bsd-sockets/win32-constants.lisp b/contrib/sb-bsd-sockets/win32-constants.lisp index 7b8e719..5b4ed07 100644 --- a/contrib/sb-bsd-sockets/win32-constants.lisp +++ b/contrib/sb-bsd-sockets/win32-constants.lisp @@ -56,7 +56,12 @@ (:integer msg-peek "MSG_PEEK") (:integer msg-dontroute "MSG_DONTROUTE") + ;; socket shutdown flags + (:integer SHUT_RD "SD_RECEIVE") + (:integer SHUT_WR "SD_SEND") + (:integer SHUT_RDWR "SD_BOTH") + ;; errors (:integer EADDRINUSE "WSAEADDRINUSE") (:integer EAGAIN "WSAEWOULDBLOCK") (:integer EBADF "WSAEBADF") @@ -111,6 +116,13 @@ (:function getprotobynumber ("getprotobynumber" (* protoent) (proto int))) + ;; FIXME: We should probably grovel the windows SOCKET type and use it in + ;; these instead of int... + + ;; KLUDGE: For historical reasons many of these prepend win32- to the symbol + ;; names. Life for Windows users of SBCL is already hard enough, so rather + ;; than break compatibility for those who directly use these, win32-sockets.lisp + ;; wraps them with prefixless wrappers. (:function win32-bind ("bind" int (sockfd int) @@ -144,6 +156,10 @@ (:function win32-close ("closesocket" int (fd int))) + (:function shutdown ("shutdown" int + (socket int) ; KLUDGE: should be SOCKET, not int. + (how int))) + (:function win32-recvfrom ("recvfrom" ssize-t (socket int) (buf (* t)) diff --git a/contrib/sb-bsd-sockets/win32-sockets.lisp b/contrib/sb-bsd-sockets/win32-sockets.lisp index c5dadac..2d1e867 100644 --- a/contrib/sb-bsd-sockets/win32-sockets.lisp +++ b/contrib/sb-bsd-sockets/win32-sockets.lisp @@ -32,6 +32,9 @@ ;;; prepend "win32-" to the symbol names. Rather than break compatibility ;;; for users depending on those names, wrap the misnamed functions in ;;; correctly named ones... +;;; +;;; FIXME: We have a deprecation pipe these days. Remove the win32-prefixes, +;;; and make deprecation-wrappers with the prefixes. (macrolet ((define-socket-fd-arg-routines (&rest names) `(progn (declaim (inline ,@names)) -- 1.7.10.4