(defsystem sb-bsd-sockets
:version "0.58"
- :depends-on (sb-rt sb-grovel)
+ :depends-on (sb-grovel)
:components ((:file "defpackage")
(:file "split" :depends-on ("defpackage"))
(:file "array-data" :depends-on ("defpackage"))
(:file "misc" :depends-on ("sockets" "constants"))
(:file "def-to-lisp")
- (:file "tests" :depends-on ("inet" "sockopt"))
(:static-file "NEWS")
;; (:static-file "INSTALL")
(provide 'sb-bsd-sockets))
(defmethod perform ((o test-op) (c (eql (find-system :sb-bsd-sockets))))
+ (operate 'load-op 'sb-bsd-sockets-tests)
+ (operate 'test-op 'sb-bsd-sockets-tests))
+
+(defsystem sb-bsd-sockets-tests
+ :depends-on (sb-rt sb-bsd-sockets)
+ :components ((:file "tests")))
+
+(defmethod perform ((o test-op) (c (eql (find-system :sb-bsd-sockets-tests))))
(or (funcall (intern "DO-TESTS" (find-package "SB-RT")))
(error "test-op failed")))
-
(format stream "printf(\"(sb-grovel::define-c-struct ~A %d)\\n\",sizeof (~A));~%" lisp-name c-name)
(dolist (e elements)
(destructuring-bind (lisp-type lisp-el-name c-type c-el-name) e
- (format stream "printf(\"(sb-grovel::define-c-accessor ~A-~A ~A ~A \");~%"
+ ;; FIXME: this format string doesn't actually guarantee
+ ;; non-multilined-string-constantness, it just makes it more
+ ;; likely. Sort out the required behaviour (and maybe make
+ ;; the generated C more readable, while we're at it...) --
+ ;; CSR, 2003-05-27
+ (format stream "printf(\"(sb-grovel::define-c-accessor ~A-~A\\n\\~% ~
+ ~A ~A \");~%"
lisp-name lisp-el-name lisp-name lisp-type)
;; offset
(format stream "{ ~A t;printf(\"%d \",((unsigned long)&(t.~A)) - ((unsigned long)&(t)) ); }~%"
(defun c-for-function (stream lisp-name alien-defn)
(destructuring-bind (c-name &rest definition) alien-defn
- (let ((*print-right-margin* nil))
- (format stream "printf(\"(cl:declaim (cl:inline ~A))\\n\");~%"
- lisp-name)
- (princ "printf(\"(sb-grovel::define-foreign-routine (" stream)
- (princ "\\\"" stream) (princ c-name stream) (princ "\\\" " stream)
- (princ lisp-name stream)
- (princ " ) " stream)
- (terpri stream)
- (dolist (d definition)
- (write d :length nil
- :right-margin nil :stream stream)
- (princ " " stream))
- (format stream ")\\n\");")
- (terpri stream))))
-
+ (format stream "printf(\"(cl:declaim (cl:inline ~A))\\n\");~%" lisp-name)
+ (format stream
+ "printf(\"(sb-grovel::define-foreign-routine (\\\"~A\\\" ~A)\\n\\~%~
+ ~{ ~W~^\\n\\~%~})\\n\");~%"
+ c-name lisp-name definition)))
(defun print-c-source (stream headers definitions package-name)
(let ((*print-right-margin* nil))
(t
(format stream
"printf(\";; Non hablo Espagnol, Monsieur~%")))))
- (format stream "exit(0);~%}")))
+ (format stream "exit(0);~%}~%")))
(defun c-constants-extract (filename output-file package)
(with-open-file (f output-file :direction :output)
;;; unix.lisp, should presumably end up somewhere else, either in sbcl
;;; itself or in sb-posix.
-("stdio.h" "sys/types.h" "sys/stat.h" "fcntl.h" "asm/errno.h" "sys/mman.h")
+("stdio.h" "sys/types.h" "sys/stat.h" "fcntl.h" "errno.h" "sys/mman.h")
((:integer eacces "EACCES" "Error code for access error")
(:integer prot-none "PROT_NONE" "mmap: no protection")