<div dir="ltr">IIRC GCC and MSVC also disagree about how to pass and return structures by value. Maybe libclang should not be returning structures by value instead?</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 15, 2014 at 3:23 PM, Stephen Fewer <span dir="ltr"><<a href="mailto:stephen_fewer@harmonysecurity.com" target="_blank">stephen_fewer@harmonysecurity.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
This patch adds compatibility for using libclang.dll built with MSVC in<br>
Borland compiled code (C++ Builder). The 32bit Borland compiler returns<br>
structures > 4 bytes and < 9 bytes using a different ABI than MSVC<br>
emits, so to workaround this you must use a Borland specific keyword<br>
__msreturn as the calling convention [0].<br>
<br>
The patch adds a define CINDEX_CC to<br>
.\tools\clang\include\clang-c\Platform.h, when using a Borland compiler,<br>
in order to specify __msreturn and then applies CINDEX_CC to all<br>
functions in the clang-c headers. Should have no effect for any other<br>
compiler.<br>
<br>
Regards,<br>
<br>
- Stephen.<br>
<br>
[0] <a href="http://docwiki.embarcadero.com/RADStudio/XE7/en/Msreturn" target="_blank">http://docwiki.embarcadero.com/RADStudio/XE7/en/Msreturn</a><br>
<br>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">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>