Hi,

I only recently discovered that on Windows, some stdcall libraries do  
funny name mangling; symbols are not named as one would expect. So a  
function 'Foo' is actually '[EMAIL PROTECTED]' in the DLL, where x is the 
amount  
of stack space, in bytes, its parameters take up. For Factor 0.89, I  
will fix the FFI so that this is supported transparently, since it is  
not hard to compute this number at all, but for now here's a workaround:

First, note that

LIBRARY: fmod
FUNCTION: float FSOUND_GetVersion ( ) ;

Is equivalent to:

: FSOUND_GetVersion
     "float" "fmod" "FSOUND_GetVersion" { } alien-invoke ;

So you can try

: FSOUND_GetVersion
     "float" "fmod" "[EMAIL PROTECTED]" { } alien-invoke ;

However the @0 might be @4, I forget if the return value is taken  
into account or not. You can use a tool to list the symbols in a DLL  
to find out.

In the future there will be a new ABI parameter, "manged-stdcall",  
just like "stdcall" except with this mangling going on behind the  
scenes. You will be able to use FUNCTION: again.

Of course we still need unmangled stdcall support since system DLLs  
like kernel32.dll are built this way. I have no idea why.

Windows is full of strange corner cases, this is just one example.

Have fun,

Slava

PS:

> I've also tried
>
> "fmod" load-library
> drop

load-library is called for you; it is only useful to call it as a  
debugging tool (see if it fails or not...)

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to