<div dir="ltr">One other thing to think about is: are typeid names of internal types unique?  MSVC seems to get it wrong, as in this prints 1:<div><br></div><div>$ cat t.cpp</div><div><div><div>#include <typeinfo></div>
<div>#ifdef CONFIG_1</div><div>namespace { struct Foo { int a; }; }</div><div>const std::type_info &tu1() { return typeid(Foo); }</div><div>#else</div><div>namespace { struct Foo { float b; }; }</div><div>const std::type_info &tu1();</div>
<div>const std::type_info &tu2() { return typeid(Foo); }</div><div>extern "C" void printf(const char *, ...);</div><div>int main() {</div><div>  printf("tu1() == tu2(): %d\n", tu1() == tu2());</div>
<div>}</div><div>#endif</div></div><div><br></div></div><div><div>$ cl -c t.cpp && cl -c -DCONFIG_1 t.cpp -Fot2.obj && cl t.obj t2.obj && ./t.exe</div></div><div>...</div><div><div>tu1() == tu2(): 1</div>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Nov 22, 2013 at 1:48 PM, Yaron Keren <span dir="ltr"><<a href="mailto:yaron.keren@gmail.com" target="_blank">yaron.keren@gmail.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="rtl"><div dir="ltr">OK, fixed.</div><div dir="ltr"><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra">
<div dir="ltr"><br><br><div class="gmail_quote">2013/11/22 Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span><br>

<blockquote class="gmail_quote" style="margin:0 .8ex;border-left:1px #ccc solid;border-right:1px #ccc solid;padding-left:1ex;padding-right:1ex">Yes, this is just a property of COFF, so it should be _WIN32.</blockquote></div>


<div class="gmail_extra"><br><br><div class="gmail_quote"><div><div>On Fri, Nov 22, 2013 at 5:18 AM, Yaron Keren <span dir="ltr"><<a href="mailto:yaron.keren@gmail.com" target="_blank">yaron.keren@gmail.com</a>></span> wrote:<br>



</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="rtl"><div dir="ltr"><div dir="ltr">On Windows, typeids are different between DLLs and EXEs, so comparing type_info* will work for typeids from the same compiled file but fail for typeids from a DLL and an executable. Among other things, exceptions are not caught by handlers since can_catch() returns false.</div>





<div dir="ltr"><br></div><div dir="ltr">Defining _LIBCXX_DYNAMIC_FALLBACK does not help since can_catch() calls is_equal() with use_strcmp=false so the string names are not compared.</div><div dir="ltr"><br></div><div>This patch compares typeids first (cheap) and only they are different calls strcmp.</div>





<div dir="ltr"><br></div><div dir="ltr">If libcxxabi with Visual C++ has the same problem, __MINGW32__ should be replaced with _WIN32 in both locations.</div><span><font color="#888888"><div dir="ltr"><br>
</div><div>Yaron</div><div><br></div></font></span></div>
</div>
<br></div></div>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div></div></div>
</div></div></blockquote></div><br></div>