|
Boost : |
Subject: Re: [boost] [winapi] Default target Windows version
From: Sergey Cheban (s.cheban_at_[hidden])
Date: 2013-10-24 01:19:09
24.10.2013 4:53, Andrey Semashev пиÑеÑ:
> I think if the user targets for XP compatibility, he has to define
> _WIN32_WINNT anyway, and not just for his code but also for all the third-
> party code he compiles. If he uses externally built binaries, he has to trust
> the provider of these binaries that they were built compatible with XP (i.e.
> with _WIN32_WINNT defined).
Many of external libraries do not use the Windows SDK at all (zlib, for
example). So, it depends. I prefer not to use the externally built
libraries but some people use them.
>> With this approach, our library will contain both implementations of the
>> condvar class (providing the SDK is not too old). To choose between
>> them, developers will have to define _WIN32_WINNT for their applications
>> but will not have to recompile our library.
> That won't work because condvar_vista would involve functions that are not
> present in XP. Any built Boost binary will contain references to these
> functions and will not load on XP.
No. The condvar_vista won't be included into the binary because it won't
be used (providing _WIN32_WINNT==0x0501 for the user's code). The whole
condvar_vista.obj will be linked out. So, the vista-specific functions
won't be referenced and the code will be WinXP-compatible.
OTOH, some developers define _WIN32_WINNT==0x0602 because they want
access to the vista-specific structures and avoid static linking to the
vista-specific functions. BOOST_USE_WINAPI_VERSION would be useful for them.
-- Best regards, Sergey Cheban
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk