Skip to content
Snippets Groups Projects
Commit 98f8f349 authored by wlott's avatar wlott
Browse files

Extracting (char *)NULL results in NIL, and depositing a NIL results in

(char *)NULL.
parent 603bf287
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
(ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/c-call.lisp,v 1.8 1992/02/14 23:44:18 wlott Exp $")
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/c-call.lisp,v 1.9 1992/02/21 17:57:59 wlott Exp $")
;;;
;;; **********************************************************************
;;;
......@@ -56,15 +56,19 @@
(def-alien-type-method (c-string :lisp-rep) (type)
(declare (ignore type))
'simple-base-string)
'(or simple-base-string null))
(def-alien-type-method (c-string :naturalize-gen) (type alien)
(declare (ignore type))
`(%naturalize-c-string ,alien))
`(if (zerop (sap-int ,alien))
nil
(%naturalize-c-string ,alien)))
(def-alien-type-method (c-string :deport-gen) (type value)
(declare (ignore type))
`(vector-sap ,value))
`(etypecase ,value
(null (int-sap 0))
(simple-base-string (vector-sap ,value))))
(defun %naturalize-c-string (sap)
(declare (type system-area-pointer sap))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment