util: Remove the __declspec(dllexport) on win32 for PUBLIC export macro

As on Windows, all DLLs are exported use def files, there is no need do __declspec(dllexport) on the function marker.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36863>
This commit is contained in:
Yonggang Luo 2025-08-14 18:57:34 +08:00 committed by Marge Bot
parent 39e20ad563
commit de1a2a3537
5 changed files with 2 additions and 29 deletions

View file

@ -503,12 +503,6 @@ radv_GetInstanceProcAddr(VkInstance _instance, const char *pName)
return vk_instance_get_proc_addr(instance, &radv_instance_entrypoints, pName);
}
/* Windows will use a dll definition file to avoid build errors. */
#ifdef _WIN32
#undef PUBLIC
#define PUBLIC
#endif
/* The loader wants us to expose a second GetInstanceProcAddr function
* to work around certain LD_PRELOAD issues seen in apps.
*/

View file

@ -1626,12 +1626,6 @@ VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL lvp_GetInstanceProcAddr(
pName);
}
/* Windows will use a dll definition file to avoid build errors. */
#ifdef _WIN32
#undef PUBLIC
#define PUBLIC
#endif
/* The loader wants us to expose a second GetInstanceProcAddr function
* to work around certain LD_PRELOAD issues seen in apps.
*/

View file

@ -1890,12 +1890,6 @@ dzn_GetInstanceProcAddr(VkInstance _instance,
pName);
}
/* Windows will use a dll definition file to avoid build errors. */
#ifdef _WIN32
#undef PUBLIC
#define PUBLIC
#endif
PUBLIC VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL
vk_icdGetInstanceProcAddr(VkInstance instance,
const char *pName)

View file

@ -289,10 +289,11 @@ do { \
/**
* This marks symbols that should be visible to dynamic library consumers.
* On win32, symbols use def file to export, do not use __declspec(dllexport)
*/
#ifndef PUBLIC
# if defined(_WIN32)
# define PUBLIC __declspec(dllexport)
# define PUBLIC
# elif defined(__GNUC__)
# define PUBLIC __attribute__((visibility("default")))
# else

View file

@ -555,16 +555,6 @@ vk_common_EnumeratePhysicalDeviceGroups(VkInstance _instance, uint32_t *pGroupCo
return vk_outarray_status(&out);
}
/* For Windows, PUBLIC is default-defined to __declspec(dllexport) to automatically export the
* public entrypoints from a DLL. However, this declspec needs to match between declaration and
* definition, and this attribute is not present on the prototypes specified in vk_icd.h. Instead,
* we'll use a .def file to manually export these entrypoints on Windows.
*/
#ifdef _WIN32
#undef PUBLIC
#define PUBLIC
#endif
/* With version 4+ of the loader interface the ICD should expose
* vk_icdGetPhysicalDeviceProcAddr()
*/