[PATCH vkd3d v2 1/2] build: Make the default symbol visibility "hidden".
Henri Verbeet
hverbeet at gmail.com
Mon Aug 9 11:29:13 CDT 2021
On Mon, 9 Aug 2021 at 18:19, Zebediah Figura (she/her)
<zfigura at codeweavers.com> wrote:
> On 8/9/21 10:29 AM, Henri Verbeet wrote:
> > On Mon, 9 Aug 2021 at 08:12, Zebediah Figura <zfigura at codeweavers.com> wrote:
> >> diff --git a/include/vkd3d_windows.h b/include/vkd3d_windows.h
> >> index 7d8a8b19..24dad10d 100644
> >> --- a/include/vkd3d_windows.h
> >> +++ b/include/vkd3d_windows.h
> >> @@ -132,18 +132,18 @@ typedef GUID IID;
> >> # ifdef INITGUID
> >> # ifndef __cplusplus
> >> # define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
> >> - const GUID name DECLSPEC_HIDDEN; \
> >> + const GUID name; \
> >> const GUID name = \
> >> { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 }}
> >> # else
> >> # define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
> >> - EXTERN_C const GUID name DECLSPEC_HIDDEN; \
> >> + EXTERN_C const GUID name; \
> >> EXTERN_C const GUID name = \
> >> { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 }}
> >> # endif
> >> # else
> >> # define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
> >> - EXTERN_C const GUID name DECLSPEC_HIDDEN;
> >> + EXTERN_C const GUID name;
> >> # endif /* INITGUID */
> >>
> >> /* __uuidof emulation */
> >> @@ -251,17 +251,6 @@ typedef struct SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES;
> >> #endif /* _WIN32 */
> >>
> >>
> >> -/* Define DECLSPEC_HIDDEN */
> >> -#ifndef DECLSPEC_HIDDEN
> >> -# if defined(__MINGW32__)
> >> -# define DECLSPEC_HIDDEN
> >> -# elif defined(__GNUC__)
> >> -# define DECLSPEC_HIDDEN __attribute__((visibility("hidden")))
> >> -# else
> >> -# define DECLSPEC_HIDDEN
> >> -# endif
> >> -#endif /* DECLSPEC_HIDDEN */
> >> -
> > I've signed off on the patch, but there may still be value in this
> > bit; this part would be included into users of vkd3d, and not all of
> > those would necessarily default to hidden visibility.
> >
>
> I think users of vkd3d would conceivably want something like
> DECLSPEC_HIDDEN, but it seems odd that they'd rely on vkd3d to get it,
> especially given that it's not a symbol defined by Windows. I.e. it
> seems somewhat out of scope.
The issue isn't so much that they no longer get access to
DECLSPEC_HIDDEN now (although I suppose that could conceivably break
users of vkd3d as well), but that DEFINE_GUID no longer gets
DECLSPEC_HIDDEN. I.e., a library that doesn't otherwise prevent those
GUID symbols from being visibile would now start exporting them.
More information about the wine-devel
mailing list