<div dir="ltr">Very annoying indeed.<div><br></div><div>Fixed in r304348. I also asked some Windows STL devs is there are other macros we need to look out for.</div><div><br></div><div>/Eric</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 31, 2017 at 2:18 PM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">That is annoying, but it seems like something that we probably should work around in libc++.<div><div class="h5"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 29, 2017 at 7:45 PM, Orivej Desh via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">At present `algorithm' and `random' can not be included after `tchar.h' [1]<br>
because it contains<br>
<br>
     #define _UI     unsigned int<br>
<br>
and the former contain templates like<br>
<br>
     template <class _UI, _UI _Xp> struct __log2<br>
<br>
that fail to compile with<br>
<br>
     algorithm:2807: error C2332: 'class': missing tag name<br>
     algorithm:2807: error C2628: '<unnamed-tag>' followed by 'unsigned' is illegal (did you forget a ';'?)<br>
     algorithm:2807: error C2628: '<unnamed-tag>' followed by 'int' is illegal (did you forget a ';'?)<br>
     algorithm:2807: error C2993: '': illegal type for non-type template parameter '<unnamed-tag>'<br>
<br>
This affects compilation of open source libraries, in particular this<br>
BDB file [2] fails to compile because it includes tchar.h [3] before C++<br>
STL.  What is the best way to resolve this?  May libc++ rename or<br>
undefine `_UI'?<br>
<br>
[1] This one is from the old vc6 crt library, but Visual Studio 2017<br>
    installs crt with the same macros:<br>
    <a href="https://github.com/weolar/miniblink49/blob/f3ffb1ee/vc6/include/crt/tchar.h#L838" rel="noreferrer" target="_blank">https://github.com/weolar/mini<wbr>blink49/blob/f3ffb1ee/vc6/incl<wbr>ude/crt/tchar.h#L838</a><br>
[2] <a href="https://github.com/berkeleydb/libdb/blob/master/lang/cxx/cxx_seq.cpp" rel="noreferrer" target="_blank">https://github.com/berkeleydb/<wbr>libdb/blob/master/lang/cxx/cxx<wbr>_seq.cpp</a><br>
[3] <a href="https://github.com/berkeleydb/libdb/blob/master/src/dbinc/win_db.h#L33" rel="noreferrer" target="_blank">https://github.com/berkeleydb/<wbr>libdb/blob/master/src/dbinc/wi<wbr>n_db.h#L33</a><br>
______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>