[PATCH vkd3d v2 1/2] build: Make the default symbol visibility "hidden".

Zebediah Figura (she/her) zfigura at codeweavers.com
Mon Aug 9 11:19:55 CDT 2021


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.



More information about the wine-devel mailing list