X-Git-Url: https://git.distorted.org.uk/~mdw/clg/blobdiff_plain/112ac1d33aa8f9b7f3d2f9542d15431f152b1d35..495de443353781c7782407ec96a6ad6698d5c11f:/glib/ffi.lisp diff --git a/glib/ffi.lisp b/glib/ffi.lisp index 5f2fc0c..728b643 100644 --- a/glib/ffi.lisp +++ b/glib/ffi.lisp @@ -20,7 +20,7 @@ ;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -;; $Id: ffi.lisp,v 1.20 2005-04-23 16:48:50 espen Exp $ +;; $Id: ffi.lisp,v 1.22 2006-02-06 11:49:50 espen Exp $ (in-package "GLIB") @@ -189,7 +189,10 @@ (%heap-alien (make-heap-alien-info :type (parse-alien-type ftype #+sbcl nil) - :sap-form (foreign-symbol-address name)))) + :sap-form (let ((address (foreign-symbol-address name))) + (etypecase address + (integer (int-sap address)) + (system-area-pointer address)))))) (translate-arguments (mapcar #'to-alien-function arg-types)) (translate-return-value (from-alien-function return-type)) (cleanup-arguments (mapcar #'cleanup-function arg-types))) @@ -268,6 +271,7 @@ (def-type-method writer-function ()) (def-type-method reader-function ()) +(def-type-method weak-reader-function ()) (def-type-method destroy-function ()) (def-type-method unbound-value () @@ -344,6 +348,9 @@ (defmethod copy-from-alien-function ((type t) &rest args) (apply #'from-alien-function type args)) +(defmethod weak-reader-function ((type symbol) &rest args) + (apply #'reader-function type args)) + (defmethod alien-type ((type (eql 'signed-byte)) &rest args) (declare (ignore type))