;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Feb 2002
;;;;
-;;;; $Id: strings.lisp,v 1.9 2003/06/12 18:32:30 kevin Exp $
+;;;; $Id: strings.lisp,v 1.10 2003/07/18 21:33:26 kevin Exp $
;;;;
;;;; This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
(def-type char-ptr-def (* :unsigned-char))
-;;#+(or lispworks (and allegro ics))
-#+(or lispworks allegro)
+#+(or lispworks (and allegro (not ics)))
(defun fast-native-to-string (s)
(declare (optimize (speed 3) (space 0) (safety 0) (compilation-speed 0))
(type char-ptr-def s))
(dotimes (i len str)
(setf (aref str i) (uffi:deref-array s '(:array :char) i)))))
-;;#+(and allegro (not ics))
+#+(and allegro ics)
+(defun fast-native-to-string (s)
+ (declare (optimize (speed 3) (space 0) (safety 0) (compilation-speed 0))
+ (type char-ptr-def s))
+ (let* ((len (strlen s))
+ (str (make-string len)))
+ (declare (fixnum len))
+ (dotimes (i len str)
+ (setf (schar str i) (ensure-char-character
+ (uffi:deref-array s '(:array :char) i))))))
+
#+ignore
(defun fast-native-to-string (s)
(declare (optimize (speed 3) (space 0) (safety 0) (compilation-speed 0) (debug 0))