master: Test the new :alien-callback definition type in sb-introspect

crhodes via Sbcl-commits <[email protected]>
Newsgroups gmane.lisp.steel-bank.cvs
Message-ID <[email protected]>
The branch "master" has been updated in SBCL:
       via  4acf4acdbdabc66630be96f3a88d9c339a5f4ec4 (commit)
      from  8a15ebb1367407fe89cf51cc1b7da0456bb49f58 (commit)

- Log -----------------------------------------------------------------
commit 4acf4acdbdabc66630be96f3a88d9c339a5f4ec4
Author: Christophe Rhodes <[email protected]>
Date:   Thu Apr 30 17:01:45 2026 +0100

    Test the new :alien-callback definition type in sb-introspect
    
    Both directly, and as a possible type for checking invalid names
---
 contrib/sb-introspect/test-driver.lisp | 8 ++++++--
 contrib/sb-introspect/test.lisp        | 5 +++++
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/contrib/sb-introspect/test-driver.lisp b/contrib/sb-introspect/test-driver.lisp
index 9da19a249..09d553ef6 100644
--- a/contrib/sb-introspect/test-driver.lisp
+++ b/contrib/sb-introspect/test-driver.lisp
@@ -745,11 +745,14 @@
 (with-test (:name alien-variable :skipped-on :no-source-locs)
   (assert (matchp-name :variable 'cl-user::test-alien-var 32)))
 
+(with-test (:name alien-callable :skipped-on :no-source-locs)
+  (assert (matchp-name :alien-callback 'cl-user::alien-comparator 33)))
+
 (with-test (:name condition-slot-reader :skipped-on :no-source-locs)
-  (matchp-name :method 'cl-user::condition-slot-reader 33))
+  (matchp-name :method 'cl-user::condition-slot-reader 34))
 
 (with-test (:name condition-slot-writer :skipped-on :no-source-locs)
-  (matchp-name :method 'cl-user::condition-slot-writer 33))
+  (matchp-name :method 'cl-user::condition-slot-writer 34))
 
 (deftest function-with-a-local-function
     (sb-introspect:definition-source-form-number
@@ -825,6 +828,7 @@
     :symbol-macro
     :type
     :alien-type
+    :alien-callback
     :variable
     :declaration
     :optimizer
diff --git a/contrib/sb-introspect/test.lisp b/contrib/sb-introspect/test.lisp
index ae677890d..aeae33449 100644
--- a/contrib/sb-introspect/test.lisp
+++ b/contrib/sb-introspect/test.lisp
@@ -85,6 +85,11 @@
 
 (sb-alien:define-alien-variable ("errno" test-alien-var) sb-alien:int)
 
+(sb-alien:define-alien-callable alien-comparator sb-alien:int
+  ((p1 (* t)) (p2 (* t)))
+  (- (sb-alien:deref (sb-alien:cast p1 (* sb-alien:int)))
+     (sb-alien:deref (sb-alien:cast p2 (* sb-alien:int)))))
+
 (define-condition test-condition (error)
   ((a :reader condition-slot-reader
       :writer condition-slot-writer)))

-----------------------------------------------------------------------


hooks/post-receive
-- 
SBCL
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.