<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">On Mon, May 27, 2013 at 5:41 PM, Peter Collingbourne <span dir="ltr"><<a href="mailto:peter@pcc.me.uk" target="_blank">peter@pcc.me.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Thu, May 23, 2013 at 06:21:33PM +0400, Alexey Samsonov wrote:<br>
> Can we use existing SANITIZER_SUPPORTS_WEAK_HOOKS macro to fix this?<br>
<br>
</div>We could enclose the "&& SymbolizeCode" part in an ifdef, but I think this<br>
would be kind of ugly.<br>
<br>
One idea I had was to define a macro like this:<br>
<br>
#if SANITIZER_WINDOWS<br>
# define SANITIZER_HAS_WEAK_SYMBOL(s) 1<br>
#else<br>
# define SANITIZER_HAS_WEAK_SYMBOL(s) (&(s))<br>
#endif<br></blockquote><div><br></div><div style>I like this idea.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
Then we can just write:<br>
<br>
if (symbolize && addr_frames_num == 0 &&<br>
</div>    SANITIZER_HAS_WEAK_SYMBOL(SymbolizeCode)) {<br>
<br>
which would probably be more readable.  There are a few more places<br>
where we'd be able to use this macro, I believe.<br>
<br>
Thanks,<br>
<span class="HOEnZb"><font color="#888888">--<br>
Peter<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Alexey Samsonov, MSK</div>
</div></div>