X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Ftarget-c-call.lisp;h=c978ac88e8da84b0ded01841abcb49e8a44ce0d6;hb=cee8ef591040db9a79cdd19297867672a9529051;hp=a3ff56a0536bba144e72e4ba3b5a7573cca6fb57;hpb=54b330585ed41edeb93a289f0e59aec67fa9ded9;p=sbcl.git diff --git a/src/code/target-c-call.lisp b/src/code/target-c-call.lisp index a3ff56a..c978ac8 100644 --- a/src/code/target-c-call.lisp +++ b/src/code/target-c-call.lisp @@ -22,13 +22,20 @@ (define-alien-type char (integer 8)) (define-alien-type short (integer 16)) (define-alien-type int (integer 32)) +#!-(and win32 x86-64) (define-alien-type long (integer #.sb!vm::n-machine-word-bits)) +#!+(and win32 x86-64) +(define-alien-type long (integer 32)) + (define-alien-type long-long (integer 64)) (define-alien-type unsigned-char (unsigned 8)) (define-alien-type unsigned-short (unsigned 16)) (define-alien-type unsigned-int (unsigned 32)) +#!-(and win32 x86-64) (define-alien-type unsigned-long (unsigned #.sb!vm::n-machine-word-bits)) +#!+(and win32 x86-64) +(define-alien-type unsigned-long (unsigned 32)) (define-alien-type unsigned-long-long (unsigned 64)) (define-alien-type float single-float) @@ -72,17 +79,12 @@ (declare (type simple-string string)) (locally (declare (optimize (speed 3) (safety 0))) - (let ((func (sb!impl::get-external-format-function external-format 10))) - (unless func - (error "Undefined external-format ~A.~%" external-format)) - (funcall (symbol-function func) string)))) + (let ((external-format (sb!impl::get-external-format-or-lose external-format))) + (funcall (sb!impl::ef-write-c-string-fun external-format) string)))) (defun c-string-to-string (sap external-format element-type) (declare (type system-area-pointer sap)) (locally (declare (optimize (speed 3) (safety 0))) - (let ((func (sb!impl::get-external-format-function external-format 9))) - (unless func - (error "Undefined external-format ~A.~%" external-format)) - (funcall (symbol-function func) sap element-type)))) - + (let ((external-format (sb!impl::get-external-format-or-lose external-format))) + (funcall (sb!impl::ef-read-c-string-fun external-format) sap element-type))))