[Openmcl-devel] foreign vars

eblood at winkywooster.org eblood at winkywooster.org
Thu Aug 19 18:19:08 UTC 2004


Hey Marco,

I have been trying to get UFFI's missing OpenMCL support implemented.  So far I
have:

(defmacro def-foreign-var (names type module)
    ...
    #+(and openmcl darwinppc-target)
    (setf foreign-name (concatenate 'string "_" foreign-name))
    #+openmcl
    (let* ((fv (ccl::load-fv foreign-name
			     (ccl::parse-foreign-type var-type)))
	   (fvform (ccl::%foreign-access-form
		    `(%reference-external-entry-point (load-time-value ,fv))
		    (ccl::fv.type fv)
		    0
		    nil)))
      `(define-symbol-macro ,lisp-name ,fvform))

and this behaves as expected for simple types.  This is based (almost verbatim)
on OpenMCL's #? macro.

However, I have an issue with loading the UFFI tests, because at load-time it is
throwing an error about the struct test. (Your post to the UFFI list caught my
attention about the struct, but I haven't had time to take a look at it.)  I
think there is also an issue with trying to fetch the variable at load-time.

Any comments are greatly appreciated.

--
eblood



More information about the Openmcl-devel mailing list