Boost logo

Boost :

Subject: Re: [boost] [winapi] Default target Windows version
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2013-10-24 05:00:03


On Thursday 24 October 2013 09:19:09 Sergey Cheban wrote:
> 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.

Libraries that don't use Windows SDK are irrelevant for the sake of this
discussion. But it is rarely a documented feature, so you would have to
inspect its code to verify that or just define _WIN32_WINNT to be on the safe
side.

> >> 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.

If condvar_vista is compiled into a dll, it won't be linked out. If you don't
compile it because _WIN32_WINNT == 0x0501 then that's the current approach
already. And it requires _WIN32_WINNT to be defined when Boost itself is
built.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk