[botan-devel] DLL_BOTAN

Jack Lloyd lloyd at randombit.net
Tue Jan 29 12:39:11 EST 2013


On Sun, Jan 27, 2013 at 02:19:45AM +1100, john skaller wrote:
> On OSX this macro is set to:
> 
> #ifndef BOTAN_DLL
>   #define BOTAN_DLL __attribute__((visibility("default")))
> #endif
> 
> in build/build/h by:
> 
> src/build-data/buildh.in:  #define BOTAN_DLL %{visibility_attribute}
> 
> [It seems to work but I see no point specifying it on unix platforms,
> why introduce a non-standard feature?]

Visibility support is actually quite useful under modern compilers
like GCC and Clang as knowing that certain code is private to the
module allows better interprocedular / whole program analysis.
Additionally reducing the number of exported symbols can purportedly
cut down on shared object load time, though likely botan doesn't have
enough symbols for that to be a huge factor anyway.

> and the idea is to override on the command line, when building a DLL,
> however there's no way to specify a value for a macro on the command line
> AFAIK. 

Under VC, /DBOTAN_DLL=__declspec(dllimport) should work.

-Jack



More information about the botan-devel mailing list