Richard Levitte - VMS Whacker wrote:
>
> From: Dr S N Henson <[EMAIL PROTECTED]>
>
> drh> An external DLL might use DECLARE_ASN1_FUNCTIONS() in its header file
> drh> and then drag in OPENSSL_EXTERN if it was added to the macro.
> drh> OPENSSL_EXTERN would then need that behaviour to work.
> drh>
> drh> If OPENSSL_EXTERN is considered illegal in external applications they
> drh> need some other way to achieve the same end.
>
> So one needs to make sure OPENSSL_BUILD_SHLIB is only defined when
> appropriate, no? But I do understand the concern if for example the
> SSL library would need to make global symbols and at the same time
> reach global symbols from the crypto library...
>
Yes thats one problem. There is in fact one place in the SSL library
where it declares some ASN1 code and it would at least have to reach
global symbols in crypto. However the stuff is so non standard I've
avoided converting it until now.
> What I mean was that it wold be stupid for external applications and
> DLL's to OPENSSL_EXTERN as if OPENSSL_BUILD_SHLIB was defined...
>
Yes certainly since it would end up with invalidly exporting the
variables declared in the OpenSSL headers.
I was considering a couple of possible ways to get round this. One is to
have OPENSSL_EXTERN, OPENSSL_IMPORT and OPENSSL_EXPORT declared in an
appropriate manner for the platform in the headers. Then any header
which needs to declare its own stuff would do something like:
#undef OPENSSL_EXTERN
#ifdef SOME_LOCAL_BUILD_FLAG
#define OPENSSL_EXTERN OPENSSL_EXPORT
#else
#define OPENSSL_EXTERN OPENSSL_IMPORT
#endif
The OpenSSL system headers could do something similar. An application
would have to ensure that the local headers were only included after
OpenSSL headers though.
Steve.
--
Dr Stephen N. Henson. http://www.drh-consultancy.demon.co.uk/
Personal Email: [EMAIL PROTECTED]
Senior crypto engineer, Celo Communications: http://www.celocom.com/
Core developer of the OpenSSL project: http://www.openssl.org/
Business Email: [EMAIL PROTECTED] PGP key: via homepage.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]