nil
(if (eq ,locale :none)
(fast-native-to-string ,obj ,length)
- (excl:native-to-string
- ,obj
- ,@(when length (list :length length))
- :truncate (not ,null-terminated-p))))
+ (values
+ (excl:native-to-string
+ ,obj
+ ,@(when length (list :length length))
+ :truncate (not ,null-terminated-p)))))
#+lispworks
`(if (fli:null-pointer-p ,obj)
nil
`(if (ccl:%null-ptr-p ,obj)
nil
#+(and mcl (not openmcl)) (ccl:%get-cstring ,obj 0 ,@(if length (list length) nil))
- #+openmcl (let ((str (ccl:%get-cstring ,obj)))
- ,(if length '(subseq str 0 length) 'str)))
+ #+openmcl ,@(if length
+ `((ccl:%str-from-ptr ,obj ,length))
+ `((ccl:%get-cstring ,obj))))
)
(let* ((len (or len (strlen s)))
(str (make-string len)))
(dotimes (i len str)
- (setf (schar str i) (code-char (uffi:deref-array s '(:array :byte) i))))))
+ (setf (schar str i) (code-char (uffi:deref-array s '(:array :unsigned-byte) i))))))