From a1a6840fb569d0461f389691a88c1c23fb181a89 Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Wed, 28 Oct 2020 15:22:37 +0000 Subject: [PATCH] vkd3d-utils: Move to .def exports Otherwise this won't work in MSVC because it'd technically be re-defining the D3D12 function prototypes with the decltypes. There is no other nice way around this. Signed-off-by: Joshua Ashton --- include/vkd3d_utils.h | 14 +++++++++++--- libs/vkd3d-utils/meson.build | 4 ++++ libs/vkd3d-utils/vkd3d-proton-utils.def | 16 ++++++++++++++++ 3 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 libs/vkd3d-utils/vkd3d-proton-utils.def diff --git a/include/vkd3d_utils.h b/include/vkd3d_utils.h index a0138c38..d16ede36 100644 --- a/include/vkd3d_utils.h +++ b/include/vkd3d_utils.h @@ -31,10 +31,18 @@ extern "C" { #define VKD3D_INFINITE (~0u) #ifdef _WIN32 -# ifdef VKD3D_UTILS_EXPORTS -# define VKD3D_UTILS_EXPORT __declspec(dllexport) +# ifdef _MSC_VER +# define VKD3D_UTILS_EXPORT # else -# define VKD3D_UTILS_EXPORT __declspec(dllimport) + /* We need to specify the __declspec(dllexport) attribute + * on MinGW because otherwise the stdcall aliases/fixups + * don't get exported. + */ +# ifdef VKD3D_UTILS_EXPORTS +# define VKD3D_UTILS_EXPORT __declspec(dllexport) +# else +# define VKD3D_UTILS_EXPORT __declspec(dllimport) +# endif # endif #elif defined(__GNUC__) # define VKD3D_UTILS_EXPORT DECLSPEC_VISIBLE diff --git a/libs/vkd3d-utils/meson.build b/libs/vkd3d-utils/meson.build index addb047d..37c26281 100644 --- a/libs/vkd3d-utils/meson.build +++ b/libs/vkd3d-utils/meson.build @@ -6,6 +6,10 @@ vkd3d_utils_lib = shared_library('vkd3d-proton-utils', vkd3d_utils_src, vkd3d_he dependencies : vkd3d_dep, include_directories : vkd3d_private_includes, install : true, + objects : not vkd3d_msvc and vkd3d_platform == 'windows' + ? 'vkd3d-proton-utils.def' + : [], + vs_module_defs : 'vkd3d-proton-utils.def', version : '2.0.0', c_args : '-DVKD3D_UTILS_EXPORTS', override_options : [ 'c_std='+vkd3d_c_std ]) diff --git a/libs/vkd3d-utils/vkd3d-proton-utils.def b/libs/vkd3d-utils/vkd3d-proton-utils.def new file mode 100644 index 00000000..aca3f818 --- /dev/null +++ b/libs/vkd3d-utils/vkd3d-proton-utils.def @@ -0,0 +1,16 @@ +LIBRARY vkd3d-proton-utils-2.dll + +EXPORTS + D3D12CreateDevice @101 + D3D12GetDebugInterface @102 + D3D12CreateRootSignatureDeserializer @107 + D3D12CreateVersionedRootSignatureDeserializer @108 + + D3D12EnableExperimentalFeatures @110 + D3D12SerializeRootSignature @115 + D3D12SerializeVersionedRootSignature @116 + + vkd3d_create_event + vkd3d_wait_event + vkd3d_signal_event + vkd3d_destroy_event