<div dir="ltr"><div>Hi Nico</div><div> </div><div>On Thu, Sep 26, 2013 at 8:39 PM, Nico Rieck <span dir="ltr"><<a href="mailto:nico.rieck@gmail.com" target="_blank">nico.rieck@gmail.com</a>></span> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">
_LIBCPP_NEW_DELETE_VIS expands to _LIBCPP_FUNC_VIS_ONLY when using libc++ (which in turn expands to nothing on Windows). When building libc++ as shared library it expands to _LIBCPP_FUNC_VIS (which in turn expands to dllexport). The new/delete operators are special cases that must not be decorated with dllimport so that they can be replaced with a local non-imported definition.<span><font color="#888888"><br>
<br>
-Nico<br></font></span></blockquote><div> </div><div><div>Would you mind clarifying that for me, please.</div><div> </div><div>First: I take it from what you say my patch *as it stands* is correct?</div><div> </div><div>
Second:</div><div>When you say "LIBCPP_NEW_DELETE_VIS expands to _LIBCPP_FUNC_VIS_ONLY when using libc++ (which in turn expands to nothing on Windows)."</div><div> </div><div><div>Do you mean "LIBCPP_NEW_DELETE_VIS expands to _LIBCPP_FUNC_VIS_ONLY when using libc++ [as a static library]" or in some other context?</div>
</div><div> </div><div>Third:</div><div>Are you saying we can't decorate the definition with _LIBCPP_NEW_DELETE_VIS or is that ok? just not to apply _LIBCPP_FUNC_VIS here. Or must it be nothing at all (other than _LIBCPP_WEAK) which is as I am tempted to read your words.</div>
<div> </div><div>It isn't decorated right now and my expectation is that the right attribute (or none) will be taken from the prototype so it will do the right thing. But I'm not clear if _LIBCPP_NEW_DELETE_VIS is ok to put on the definition as there may be some interest to do that for documentation reasons but obviously not if doing that would change the meaning. We don't decorate definitions generally currently, but there maybe a call to consider doing that.</div>
<div> </div><div>By the way, I really think we should rename some of these macros. I find them too passive. _LIBCPP_FUNC_VIS etc. just feels like it's saying "I have a visibility" but without saying what it is, I prefer DLL_PUBLIC or something along with DLL_LOCAL. Anyone from a windows background will likely totally not get the current names. If I'm correct, even non windows people aren't immediately clear about what the gcc based names do. They themselves feel the same:</div>
<div><a href="http://gcc.gnu.org/wiki/Visibility">http://gcc.gnu.org/wiki/Visibility</a></div><div> </div><div>Anyone agree? </div><div><br> </div></div></div>