<div dir="ltr"><div>There are two indications that it's definition and not a declaration:</div><div><br></div><div>- absence of "extern" keyword</div><div>- presence of initialization ( = { 0x... )</div><div><br></div><div>If it was compiled as C/C++ code, it would allocate memory in the current compilation unit while a declaration would just refer to something outside the compilation unit.</div><div><br></div><div>Definitions are rare in header files as they usually lead to duplicate symbol errors at link time. But through the magic of 
__declspec(selectany), this is avoided.

</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Sep 6, 2022 at 12:11 PM Maurizio Cimadamore <<a href="mailto:maurizio.cimadamore@oracle.com">maurizio.cimadamore@oracle.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
On 05/09/2022 16:32, Manuel Bleichenbacher wrote:<br>
> extern "C" const GUID __declspec(selectany) GUID_DEVINTERFACE_USB_DEVICE<br>
>     = { 0xA5DCBF10L, 0x6530, 0x11D2, { 0x90, 0x1F,  0x00,  0xC0, <br>
>  0x4F,  0xB9,  0x51,  0xED } };<br>
><br>
I guess the problem here is the lack of "dllexport", right?<br>
<br>
But, while dllexport is common, some libraries can still export symbols <br>
using a .def file [1].<br>
<br>
So, I'm not sure this belongs in the same category as "static inline", <br>
as it is not possible, just by looking at the header, to understand <br>
whether the symbol will be present or not?<br>
<br>
[1] - <br>
<a href="https://docs.microsoft.com/en-us/cpp/build/exporting-from-a-dll-using-def-files?view=msvc-170" rel="noreferrer" target="_blank">https://docs.microsoft.com/en-us/cpp/build/exporting-from-a-dll-using-def-files?view=msvc-170</a><br>
<br>
</blockquote></div>