[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: Re: DLL functions returning structs
From:       Jon Griffiths <jon_p_griffiths () yahoo ! com>
Date:       2000-11-23 11:38:15
[Download RAW message or body]

Hi,
 
--- Mike McCormack <mike_mccormack@looksmart.com.au> wrote:
> Why not implement the function using windows calling convention,
> then
> provide a macro/inline function hack in the appropriate header file
> that, when compiling winelib, converts unix struct calling
> convention
> to the windows one?
 
Hmm. If the .so uses the windows calling convention then calls
through 
GetProcAddress() will also fail unless the caller knows whats going
on.You have to do something like: 

div_t ldt;
p_ldiv(20L,3L);
__asm__ __volatile__( "movl %%eax, %0;" : "=m" (ldt.quot) : );
__asm__ __volatile__( "movl %%edx, %0;" : "=m" (ldt.rem) : );  

but the rare occasions this would come up could be documented.

from my (very limited)  understanding on the new linking method,
providing inlines/macros wont be needed. We could (for example)
#define ldiv _wine_ldiv (or something), and export _wine_ldiv from
the DLL (it would contain the wrapper code), keeping the nastyness
hidden inside the dll.

Your idea seems nicer to me than changing the compiler flags; I have
reservations about compatibility with that. I'll get some sleep
> -)and check both methods out.

Cheers,
Jon



=====
"May their negative actions ripen upon me. And may all my virtues ripen upon \
them."-Nagarjuna, on Compassion

"If it could be talked about, everybody would have told their brother."-Chuang Tzu, \
on Tao

tntjpgriff@tsnxt.co.uk , jon_p_griffiths@yahoo.com

__________________________________________________
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic