Subject: Re: [Boost-bugs] [Boost C++ Libraries] #1740: date_time includes <windows.h>
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-09-25 20:09:12
#1740: date_time includes <windows.h>
-----------------------------------+----------------------------------------
Reporter: Anteru@⦠| Owner: az_sw_dude
Type: Bugs | Status: closed
Milestone: Boost 1.36.0 | Component: date_time
Version: Boost 1.39.0 | Severity: Problem
Resolution: fixed | Keywords: windows.h date_time
-----------------------------------+----------------------------------------
Changes (by anonymous):
* status: reopened => closed
* resolution: => fixed
Comment:
Replying to [comment:6 anonymous]:
> If you do include windows.h anywhere in boost, you need the following
two lines of code just above it:
>
> {{{
> #undef WIN32_LEAN_AND_MEAN // add this...
> #define WIN32_LEAN_AND_MEAN // ...and this
> #include <windows.h>
> }}}
>
> Otherwise, if some other 3rd party lib includes <windows.h>, it will
break the build unless the header files are in a very specific order,
which is extremely tedious to maintain.
First, Boost.DateTime no longer includes windows.h by default. You can
explicitly enable it to include windows.h by defining BOOST_USE_WINDOWS_H.
Second, defining WIN32_LEAN_AND_MEAN will disable quite a few components
in windows.h. Boost.DateTime is in no position to enforce this decision in
its headers. If you want windows.h to behave like when WIN32_LEAN_AND_MEAN
is defined, you should define it in your project, before including any
headers.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/1740#comment:7> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:01 UTC