On Fri, 20 May 2005, John Morrison wrote:
> * (SB-SYS:GET-DYNAMIC-FOREIGN-SYMBOL-ADDRESS "_ZNSt9exceptionC1Ev")
> STYLE-WARNING: Undefined alien: "_ZNSt9exceptionC1Ev"
> Longer Version: GCCXML emits records for everything, including the
> above (constructor for std::exception). However, when I try to
> define-alien-routine, it errors.
What do you mean by errors? The intention is that DEFINE-ALIEN-ROUTINE
should just give the same undefined-alien style-warning, and only actually
_calling_ it should signal an error.
What version of SBCL are you using?
This is SBCL 0.9.0.28, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.
SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
* (define-alien-routine foobar int)
;
; caught STYLE-WARNING:
; Undefined alien: "foobar"
;
; compilation unit finished
; caught 1 STYLE-WARNING condition
FOOBAR
* (foobar)
debugger invoked on a SB-KERNEL::UNDEFINED-ALIEN-FUNCTION-ERROR in thread
5590:
Attempt to call an undefined alien function.
As for you actual question, I think maybe we should and could provide
SB-ALIEN:ALIEN-SYMBOL-ADDRESS (or -SAP?), that would accept an optional
argument to indicate what should be done if the symbol cannot be found.
Currently, you would need to write your own using
GET-DYNAMIC-FOREIGN-SYMBOL-ADDRESS as a starting point.
Cheers,
-- Nikodemus Schemer: "Buddha is small, clean, and serious."
Lispnik: "Buddha is big, has hairy armpits, and laughs."
|