I'm forwarding a previous message concerning this issue:

----- Original Message ----- 
From: Richard Levitte - VMS Whacker <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, January 04, 2001 11:50 AM
Subject: Re: Windows, DLLs and variables.


> From: "Rob Neff" <[EMAIL PROTECTED]>
> 
> neff.ra> #ifdef MYDLL_EXPORTS
> neff.ra> #define MYDLL_API __declspec(dllexport)
> neff.ra> #else
> neff.ra> #define MYDLL_API __declspec(dllimport)
> neff.ra> #endif
> neff.ra> 
> neff.ra> extern MYDLL_API int nTestdll;
> neff.ra> 
> neff.ra> MYDLL_API int fnTestdll(void);
> 
> That's basically what is in place in the current development source.
> I gotta ask you though, do function declarations really need to be
> prefixed that way too?  We've seemed to do fine without that so far...
> 


The following is copied from MS VC++ 6.0 online help:

-----
You do not need to use __declspec(dllimport) for your code to
compile correctly, but doing so allows the compiler to generate
better code. The compiler is able to generate better code because
it knows for sure whether a function exists in a DLL or not, so the
compiler can produce code that skips a level of indirection that
would normally be present in a function call that crossed a DLL
boundary. However, you must use __declspec(dllimport) in order
to import variables used in a DLL.

With the proper .DEF file EXPORTS section, __declspec(dllexport)
is not required. __declspec(dllexport) was added to provide an easy
way to export functions from an .EXE or .DLL without using a .DEF file.
-----

Hope that helps,
Rob


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to