From 5bfca29deb8b4c214a86ccf37279cc5cea2151e1 Mon Sep 17 00:00:00 2001 From: "Paul A. Patience" Date: Thu, 16 May 2024 09:41:01 -0400 Subject: [PATCH] Add WITH-POINTER-TO-VECTOR-DATA for Clasp (#385) --- src/cffi-clasp.lisp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/cffi-clasp.lisp b/src/cffi-clasp.lisp index 27b3e18..9e9a3f9 100644 --- a/src/cffi-clasp.lisp +++ b/src/cffi-clasp.lisp @@ -107,11 +107,10 @@ SIZE-VAR is supplied, it will be bound to SIZE during BODY." WITH-POINTER-TO-VECTOR-DATA." (make-array size :element-type '(unsigned-byte 8))) -;; frgo, 2016-07-02: TODO: Implemenent! -;; (defmacro with-pointer-to-vector-data ((ptr-var vector) &body body) -;; "Bind PTR-VAR to a foreign pointer to the data in VECTOR." -;; `(let ((,ptr-var (si:make-foreign-data-from-array ,vector))) -;; ,@body)) +(defmacro with-pointer-to-vector-data ((ptr-var vector) &body body) + "Bind PTR-VAR to a foreign pointer to the data in VECTOR." + `(let ((,ptr-var (ext:array-pointer ,vector))) + ,@body)) (defun %foreign-type-size (type-keyword) "Return the size in bytes of a foreign type." -- 2.11.4.GIT