[botan-devel] Error Compiling Botan with VS2008 and unicode character project setting

Joel Low joel at joelsplace.sg
Mon Dec 12 19:58:02 EST 2011


I'm not too sure, but my inclination when dealing with such code is to convert the ANSI to Unicode and call the W version regardless, unless you're intending to target Win9x (which IIRC VS2008 does not support anyway -- what are the compilers supported by Botan, Jack?)

The reinterpret_cast will *definitely* cause LoadLibraryW to fail at runtime.

Regards,
Joel

> -----Original Message-----
> From: botan-devel-bounces at randombit.net [mailto:botan-devel-
> bounces at randombit.net] On Behalf Of Jack Lloyd
> Sent: Tuesday, 13 December, 2011 5:27 AM
> To: Botan development list
> Subject: Re: [botan-devel] Error Compiling Botan with VS2008 and
> unicode character project setting
> 
> On Mon, Dec 12, 2011 at 09:54:35PM +0100, tobeki at gmx.de wrote:
> 
> > ...
> > #elif defined(BOTAN_TARGET_OS_HAS_LOADLIBRARY)
> >
> > #if defined UNICODE
> > lib = ::LoadLibrary(reinterpret_cast<LPCWSTR>(lib_name.c_str())); //
> > or LoadLibraryW #else lib = ::LoadLibrary(lib_name.c_str()); // or
> > LoadLibraryA #endif
> 
> That reinterpret_cast<LPCWSTR> looks pretty dubious to me, does this
> really work? Or just compile? I'm thinking this should perhaps be
> LoadLibraryA to force ANSI regardless of project settings.
> 
> > Is it possible to deactivate the dynamic load engine module by
> “python configure.py...” ?
> 
> Yes, `configure.py --disable-modules=dyn_load`
> 
> -Jack
> _______________________________________________
> botan-devel mailing list
> botan-devel at randombit.net
> http://lists.randombit.net/mailman/listinfo/botan-devel


More information about the botan-devel mailing list