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

2017-05-31 Thread Eric Fiselier via Phabricator via cfe-commits
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



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2017-05-31 Thread Casey Carter via Phabricator via cfe-commits
CaseyCarter added a comment.

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.


https://reviews.llvm.org/D33741



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2017-05-31 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF added a comment.

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

> I have no objection to undeffing min/max although I wouldn't do this myself 
> (it creates order dependencies which I think are totally evil).

Yeah, the header order is super evil. Agreed.


https://reviews.llvm.org/D33741



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2017-05-31 Thread Stephan T. Lavavej via Phabricator via cfe-commits
STL_MSFT added a comment.

I haven't seen min/max test failures, probably because our CRT/STL headers 
never drag in Windows.h.

I have no objection to undeffing min/max although I wouldn't do this myself (it 
creates order dependencies which I think are totally evil).


https://reviews.llvm.org/D33741



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2017-05-31 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF created this revision.

After changing libc++ to push/pop the min/max macros on Windows we have a bunch 
of new test  failures, caused by tests using min/max. I would like to use 
test_macros.h to undefine it.

Would this work for you? How have you been dealing with these failures?


https://reviews.llvm.org/D33741

Files:
  test/support/test_macros.h


Index: test/support/test_macros.h
===
--- test/support/test_macros.h
+++ test/support/test_macros.h
@@ -223,6 +223,14 @@
 }
 #endif
 
+#if defined(min)
+#undef min
+#endif
+
+#if defined(max)
+#undef max
+#endif
+
 #if defined(__GNUC__)
 #pragma GCC diagnostic pop
 #endif


Index: test/support/test_macros.h
===
--- test/support/test_macros.h
+++ test/support/test_macros.h
@@ -223,6 +223,14 @@
 }
 #endif
 
+#if defined(min)
+#undef min
+#endif
+
+#if defined(max)
+#undef max
+#endif
+
 #if defined(__GNUC__)
 #pragma GCC diagnostic pop
 #endif
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits