Boost logo

Boost Users :

Subject: Re: [Boost-users] 1.49 header order conflicts on Windows
From: Lars Viklund (zao_at_[hidden])
Date: 2012-06-14 16:25:52


On Thu, Jun 14, 2012 at 04:16:08PM -0400, Brian Wood wrote:
> Lars Viklund:
>
> > Asio is "friendly" enough to define WIN32_LEAN_AND_MEAN for you, which
> > pretty much breaks any other consumer of Windows.h.
>
> I wasn't aware that that's a no-no and am doing the same thing.
> My code doesn't compile without the define so am wondering what can
> be done to help.

Lean and mean is a historical artifact from the days where you might not
need all of the things that Windows.h pulled in, and if you were sure
that you didn't, you could define it to prevent the less used things
like HDROP to be defined.

Sadly, as the only documented way to get those definitions is to include
Windows.h with the right flags, and you only get one shot at including a
header in a TU, you're properly hosed if someone goes and
defines/includes that before you get to, unless you have the ability to
inhibit it.

In pretty much every single GUI project I do, I eventually include Asio,
which will promptly break everything, especially ATL.

If your code doesn't build unless you define WIN32_LEAN_AND_MEAN, you
should change your code to not collide with the parts of the Windows API
that are hidden behind that guard.

As for your other (removed) question, ask that in a separate thread, as
it doesn't really have anything to do with the current topic.

-- 
Lars Viklund | zao_at_[hidden]

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net