diff options
author | Matthias Köppe <mkoeppe@mail.math.uni-magdeburg.de> | 2004-07-24 15:17:15 +0000 |
---|---|---|
committer | Matthias Köppe <mkoeppe@mail.math.uni-magdeburg.de> | 2004-07-24 15:17:15 +0000 |
commit | 7be172dc68172ee368fc92803a5d8e40a7b35007 (patch) | |
tree | d9e17b9beb454f631ccb972a0e04058e5d63a453 /Lib/guile/common.scm | |
parent | dc1b770f0ea80f9c0da06d920aba4917dd813153 (diff) | |
download | swig-7be172dc68172ee368fc92803a5d8e40a7b35007.tar.gz |
Don't depend on the presence of the SWIG-PointerAddress function.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6065 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Lib/guile/common.scm')
-rw-r--r-- | Lib/guile/common.scm | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Lib/guile/common.scm b/Lib/guile/common.scm index 4c9128289..a51d3a71d 100644 --- a/Lib/guile/common.scm +++ b/Lib/guile/common.scm @@ -47,7 +47,13 @@ (display (number->string (object-address o) 16) file)) (define (display-pointer-address o file) - (display (number->string (SWIG-PointerAddress o) 16) file)) + ;; Don't fail if the function SWIG-PointerAddress is not present. + (let ((address (false-if-exception (SWIG-PointerAddress o)))) + (if address + (begin + (display " @ " file) + (display (number->string address 16) file))))) + (define-method (write (o <swig>) file) ;; We display _two_ addresses to show the object's identity: ;; * first the address of the GOOPS proxy object, @@ -61,9 +67,10 @@ (display (class-name class) file) (display #\space file) (display-address o file) - (display " @ " file) (display-pointer-address o file) (display ">" file)) (next-method)))) (export <swig-metaclass> <swig>) + +;;; common.scm ends here |