<div dir="rtl"><div dir="ltr">Hi Marshal,</div><div dir="ltr"><br></div><div dir="ltr">If min or max is defined before libcxx, it will warn:</div><div dir="ltr"><br></div><div dir="ltr"><div dir="ltr">../../libcxx/include\__undef_min_max:16:2: warning: : macro min is incompatible with C++. #undefing min [-W#warnings]  #warning: macro min is incompatible with C++.  #undefing min</div>

<div dir="ltr"><br></div><div>If min or max is defined after libcxx it's will clash with uses of min and max in user code.</div><div><br></div><div>Either way defining min or max is not compatible with libcxx (or any other standard C++).</div>

<div><br></div><div>The user does not really have choice. He would have to make sure min and max are not defined when using libcxx.  Defining NOMINMAX helps the user in a common use-case.</div><div><br></div><div>Yaron</div>

<div><br></div><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div dir="ltr">2013/11/18 Marshall Clow <span dir="ltr"><<a href="mailto:mclow.lists@gmail.com" target="_blank">mclow.lists@gmail.com</a>></span></div>

<blockquote class="gmail_quote" style="margin:0 .8ex;border-left:1px #ccc solid;border-right:1px #ccc solid;padding-left:1ex;padding-right:1ex"><div style="word-wrap:break-word"><div><div class="im"><div>On Nov 15, 2013, at 3:40 PM, Yaron Keren <<a href="mailto:yaron.keren@gmail.com" target="_blank">yaron.keren@gmail.com</a>> wrote:</div>

<br><blockquote type="cite"><div dir="rtl"><div dir="ltr">It may be ok for the library (I did not check yet if ntdef.h or minwindef.h are not included indirectly somehow) but will pose a possible problem for the libcxx user: </div>

<div dir="ltr">if he  includes libcxx header followed by <windows.h> without <span style="font-size:12.800000190734863px;font-family:arial,sans-serif">NOMINMAX</span> defined he would get min and max defined and trouble.<br>



</div><div dir="ltr"><br></div><div dir="ltr">So to be on the safe side, we would like to get <span style="font-size:12.800000190734863px;font-family:arial,sans-serif">NOMINMAX</span> always defined.</div><div dir="ltr">


<br>
</div><div dir="ltr">What do you think about moving the code to  __config:</div><div dir="ltr"><br></div><div dir="ltr">#ifdef _WIN32</div><div dir="ltr"><div dir="ltr">#ifndef NOMINMAX</div><div dir="ltr">#define NOMINMAX</div>



<div dir="ltr">#endif</div><div>#endif</div><div><br></div><div>It will work if the library user includes libcxx before window.h.</div><div><br></div><div>In the reverse case we can't avoid getting min and max defined but __undef_min_max will warn and undef them.</div>

</div></div></blockquote><div><br></div></div>In general, I think that this is a bad idea; we're dictating policy to the user of the library.</div><div><br></div><div>Besides, it already exists :-)  in include/support/win32/support.h.</div>

<div class="im"><div><br></div><div><br></div><div>-- Marshall</div><div><span style="border-collapse:separate;border-spacing:0px"><br>Marshall Clow     Idio Software   <<a href="mailto:mclow.lists@gmail.com" target="_blank">mailto:mclow.lists@gmail.com</a>><br>

<br>A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).<br>        -- Yu Suzuki</span>

</div>
<br></div></div></blockquote></div><br></div>