1.0.3.33: sb-bsd-sockets fixes for x86-64/darwin
[sbcl.git] / contrib / sb-bsd-sockets / name-service.lisp
index f375562..40c9cf5 100644 (file)
                 until (sb-alien:null-alien ad)
                 collect (ecase (sockint::hostent-type h)
                           (#.sockint::af-inet
+                           ;; CLH: Work around x86-64 darwin bug here.
+                           ;; The length is reported as 8, when it should be 4.
+                           #+(and darwin x86-64)
+                           (progn
+                             (assert (or (= length 4) (= length 8)))
+                             (naturalize-unsigned-byte-8-array ad 4))
+                           #-(and darwin x86-64)
+                           (progn
                              (assert (= length 4))
-                             (naturalize-unsigned-byte-8-array ad length))
+                             (naturalize-unsigned-byte-8-array ad length)))
                           #-win32
                           (#.sockint::af-local
                            (sb-alien:cast ad sb-alien:c-string))))))