Racket - NULL pointer handling

SWIG now converts a C/C++ NULL pointer into a null value by calling
scheme_make_null(), so that scheme's null? is true for a NULL C/C++
pointer value.

Consistency with Guile and needed for a pending commit for handling
NULL and std::unique_ptr.
This commit is contained in:
William S Fulton 2022-08-26 23:20:13 +01:00
commit 2cfd77b1c0
5 changed files with 31 additions and 9 deletions

View file

@ -0,0 +1,3 @@
(dynamic-call "scm_init_null_pointer_module" (dynamic-link "./libnull_pointer"))
(load "testsuite.scm")
(load "../schemerunme/null_pointer.scm")

View file

@ -0,0 +1,3 @@
(load-extension "null_pointer.so")
(load "../schemerunme/null_pointer.scm")

View file

@ -0,0 +1,8 @@
(define null '())
(unless (funk null)
(error "funk(null) does not return true"))
(unless (null? (getnull))
(error "NULL pointer should be null"))
(exit 0)