summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNormunds Rieksts <normunds.rieksts+arm@gmail.com>2023-04-17 10:59:19 +0000
committerNormunds Rieksts <normunds.rieksts+arm@gmail.com>2023-04-17 10:59:19 +0000
commit43d806de38388ed83d40c78314e85268aca735e6 (patch)
tree812112b2f9c1c6fe5aca9737359f6988b4795050
parent5befc4cb7d831b55c51e9f2339c40c0f739c5f71 (diff)
downloadvulkan-wsi-layer-43d806de38388ed83d40c78314e85268aca735e6.tar.gz
vulkan-wsi-layer-43d806de38388ed83d40c78314e85268aca735e6.tar.bz2
vulkan-wsi-layer-43d806de38388ed83d40c78314e85268aca735e6.zip
Replace VK_LAYER_EXPORT with VWL_VKAPI_EXPORT
-rw-r--r--layer/layer.cpp5
-rw-r--r--util/macros.hpp11
2 files changed, 13 insertions, 3 deletions
diff --git a/layer/layer.cpp b/layer/layer.cpp
index cc5634b..8ecc165 100644
--- a/layer/layer.cpp
+++ b/layer/layer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2022 Arm Limited.
+ * Copyright (c) 2016-2023 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -377,7 +377,8 @@ wsi_layer_vkCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateIn
}
VWL_VKAPI_CALL(VkResult)
-VK_LAYER_EXPORT wsi_layer_vkNegotiateLoaderLayerInterfaceVersion(VkNegotiateLayerInterface *pVersionStruct) VWL_API_POST
+VWL_VKAPI_EXPORT wsi_layer_vkNegotiateLoaderLayerInterfaceVersion(VkNegotiateLayerInterface *pVersionStruct)
+ VWL_API_POST
{
assert(pVersionStruct);
assert(pVersionStruct->sType == LAYER_NEGOTIATE_INTERFACE_STRUCT);
diff --git a/util/macros.hpp b/util/macros.hpp
index 058b5be..505df90 100644
--- a/util/macros.hpp
+++ b/util/macros.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Arm Limited.
+ * Copyright (c) 2021, 2023 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -39,7 +39,16 @@
* are used by C code.
* VWL_API_POST - Placed at the end of the function signature. These will typically be
* functions that need to be callable from C.
+ * VWL_VKAPI_EXPORT - Marks that the symbol should use the "default" visibility
*/
#define VWL_VKAPI_CALL(ret_type) extern "C" VKAPI_ATTR ret_type VKAPI_CALL
#define VWL_CAPI_CALL(ret_type) extern "C" ret_type
#define VWL_API_POST noexcept
+
+#if defined(__GNUC__) && __GNUC__ >= 4
+#define VWL_VKAPI_EXPORT __attribute__((visibility("default")))
+#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)
+#define VWL_VKAPI_EXPORT __attribute__((visibility("default")))
+#else
+#define VWL_VKAPI_EXPORT
+#endif \ No newline at end of file