Skip to content

Commit 6b289ea

Browse files
Use MACROS to make functions C-compatible
1 parent 3632d67 commit 6b289ea

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

include/vengine/vulkan.hpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ namespace vengine::vulkan
3131
#include <vengine/vulkan/defaults.hpp>
3232
#include <vengine/vulkan/enumerate.hpp>
3333

34+
#define UNARYPRED(NAME, T) bool (*const NAME)(const T&)
35+
#define UNARYSCORE(NAME, T) ui32 (*const NAME)(const T&)
36+
3437
extern "C" namespace vengine::vulkan
3538
{ using namespace VE_VK::defaults;
3639
using namespace vengine::algorithm;
@@ -39,10 +42,13 @@ extern "C" namespace vengine::vulkan
3942
(const char* appName,
4043
ui32 appVersion) NX;
4144
ND INL VkError pickPhysicalDevice
42-
(UnaryPred<VkPhysicalDevice> f = VE_VK_DE::isDeviceSuitable,
43-
UnaryScore<VkPhysicalDevice> s = VE_VK_DE::scoreDevice) NX;
45+
(UNARYPRED(f, VkPhysicalDevice) = VE_VK_DE::isDeviceSuitable,
46+
UNARYSCORE(s, VkPhysicalDevice) = VE_VK_DE::scoreDevice) NX;
4447
}
4548

49+
#undef UNARYPRED
50+
#undef UNARYSCORE
51+
4652
void VE_VK::destroy () NX
4753
{ using namespace VE_VK;
4854
vkDestroyInstance (instance, allocator);

0 commit comments

Comments
 (0)