[PATCH] D33741: [libc++] Undef min/max in test_macros.h

Eric Fiselier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 31 16:25:03 PDT 2017


EricWF abandoned this revision.
EricWF added a comment.

In https://reviews.llvm.org/D33741#769421, @CaseyCarter wrote:

> In https://reviews.llvm.org/D33741#769381, @EricWF wrote:
>
> > In https://reviews.llvm.org/D33741#769371, @STL_MSFT wrote:
> >
> > > I haven't seen min/max test failures, probably because our CRT/STL headers never drag in Windows.h.
> >
> >
> > Ah, that makes sense. Libc++ currently does although the plan is to fix that eventually. :-S
>
>
> Are you aware that Windows.h won't define `min` and `max` if you define `NOMINMAX` before including it? You could solve the problem by adding `-DNOMINMAX` to your test compile parameters.


I want to avoid modifying how Windows.h is included in the libc++ headers, in case people actually depend on that macro.

However passing -DNOMINMAX as a test compiler parameter is a much better solution. Thanks!


https://reviews.llvm.org/D33741





More information about the cfe-commits mailing list