Add macros VMA_CALL_PRE, VMA_CALL_POST to easily declare public functions as exported

Fixes #76
diff --git a/src/vk_mem_alloc.h b/src/vk_mem_alloc.h
index 623f860..231da7f 100644
--- a/src/vk_mem_alloc.h
+++ b/src/vk_mem_alloc.h
@@ -1718,6 +1718,18 @@
     #endif

 #endif

 

+// Define these macros to decorate all public functions with additional code,

+// before and after returned type, appropriately. This may be useful for

+// exporing the functions when compiling VMA as a separate library. Example:

+// #define VMA_CALL_PRE  __declspec(dllexport)

+// #define VMA_CALL_POST __cdecl

+#ifndef VMA_CALL_PRE

+    #define VMA_CALL_PRE

+#endif

+#ifndef VMA_CALL_POST

+    #define VMA_CALL_POST

+#endif

+

 /** \struct VmaAllocator

 \brief Represents main object of this library initialized.

 

@@ -1943,19 +1955,19 @@
 } VmaAllocatorCreateInfo;

 

 /// Creates Allocator object.

-VkResult vmaCreateAllocator(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateAllocator(

     const VmaAllocatorCreateInfo* pCreateInfo,

     VmaAllocator* pAllocator);

 

 /// Destroys allocator object.

-void vmaDestroyAllocator(

+VMA_CALL_PRE void VMA_CALL_POST vmaDestroyAllocator(

     VmaAllocator allocator);

 

 /**

 PhysicalDeviceProperties are fetched from physicalDevice by the allocator.

 You can access it here, without fetching it again on your own.

 */

-void vmaGetPhysicalDeviceProperties(

+VMA_CALL_PRE void VMA_CALL_POST vmaGetPhysicalDeviceProperties(

     VmaAllocator allocator,

     const VkPhysicalDeviceProperties** ppPhysicalDeviceProperties);

 

@@ -1963,7 +1975,7 @@
 PhysicalDeviceMemoryProperties are fetched from physicalDevice by the allocator.

 You can access it here, without fetching it again on your own.

 */

-void vmaGetMemoryProperties(

+VMA_CALL_PRE void VMA_CALL_POST vmaGetMemoryProperties(

     VmaAllocator allocator,

     const VkPhysicalDeviceMemoryProperties** ppPhysicalDeviceMemoryProperties);

 

@@ -1973,7 +1985,7 @@
 This is just a convenience function. Same information can be obtained using

 vmaGetMemoryProperties().

 */

-void vmaGetMemoryTypeProperties(

+VMA_CALL_PRE void VMA_CALL_POST vmaGetMemoryTypeProperties(

     VmaAllocator allocator,

     uint32_t memoryTypeIndex,

     VkMemoryPropertyFlags* pFlags);

@@ -1986,7 +1998,7 @@
 when a new frame begins. Allocations queried using vmaGetAllocationInfo() cannot

 become lost in the current frame.

 */

-void vmaSetCurrentFrameIndex(

+VMA_CALL_PRE void VMA_CALL_POST vmaSetCurrentFrameIndex(

     VmaAllocator allocator,

     uint32_t frameIndex);

 

@@ -2017,7 +2029,7 @@
 } VmaStats;

 

 /// Retrieves statistics from current state of the Allocator.

-void vmaCalculateStats(

+VMA_CALL_PRE void VMA_CALL_POST vmaCalculateStats(

     VmaAllocator allocator,

     VmaStats* pStats);

 

@@ -2030,12 +2042,12 @@
 /// Builds and returns statistics as string in JSON format.

 /** @param[out] ppStatsString Must be freed using vmaFreeStatsString() function.

 */

-void vmaBuildStatsString(

+VMA_CALL_PRE void VMA_CALL_POST vmaBuildStatsString(

     VmaAllocator allocator,

     char** ppStatsString,

     VkBool32 detailedMap);

 

-void vmaFreeStatsString(

+VMA_CALL_PRE void VMA_CALL_POST vmaFreeStatsString(

     VmaAllocator allocator,

     char* pStatsString);

 

@@ -2270,7 +2282,7 @@
 type of resource you want to use it for. Please check parameters of your

 resource, like image layout (OPTIMAL versus LINEAR) or mip level count.

 */

-VkResult vmaFindMemoryTypeIndex(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaFindMemoryTypeIndex(

     VmaAllocator allocator,

     uint32_t memoryTypeBits,

     const VmaAllocationCreateInfo* pAllocationCreateInfo,

@@ -2288,7 +2300,7 @@
 - `vmaFindMemoryTypeIndex`

 - `vkDestroyBuffer`

 */

-VkResult vmaFindMemoryTypeIndexForBufferInfo(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaFindMemoryTypeIndexForBufferInfo(

     VmaAllocator allocator,

     const VkBufferCreateInfo* pBufferCreateInfo,

     const VmaAllocationCreateInfo* pAllocationCreateInfo,

@@ -2306,7 +2318,7 @@
 - `vmaFindMemoryTypeIndex`

 - `vkDestroyImage`

 */

-VkResult vmaFindMemoryTypeIndexForImageInfo(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaFindMemoryTypeIndexForImageInfo(

     VmaAllocator allocator,

     const VkImageCreateInfo* pImageCreateInfo,

     const VmaAllocationCreateInfo* pAllocationCreateInfo,

@@ -2451,14 +2463,14 @@
 @param pCreateInfo Parameters of pool to create.

 @param[out] pPool Handle to created pool.

 */

-VkResult vmaCreatePool(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreatePool(

 	VmaAllocator allocator,

 	const VmaPoolCreateInfo* pCreateInfo,

 	VmaPool* pPool);

 

 /** \brief Destroys #VmaPool object and frees Vulkan device memory.

 */

-void vmaDestroyPool(

+VMA_CALL_PRE void VMA_CALL_POST vmaDestroyPool(

     VmaAllocator allocator,

     VmaPool pool);

 

@@ -2468,7 +2480,7 @@
 @param pool Pool object.

 @param[out] pPoolStats Statistics of specified pool.

 */

-void vmaGetPoolStats(

+VMA_CALL_PRE void VMA_CALL_POST vmaGetPoolStats(

     VmaAllocator allocator,

     VmaPool pool,

     VmaPoolStats* pPoolStats);

@@ -2479,7 +2491,7 @@
 @param pool Pool.

 @param[out] pLostAllocationCount Number of allocations marked as lost. Optional - pass null if you don't need this information.

 */

-void vmaMakePoolAllocationsLost(

+VMA_CALL_PRE void VMA_CALL_POST vmaMakePoolAllocationsLost(

     VmaAllocator allocator,

     VmaPool pool,

     size_t* pLostAllocationCount);

@@ -2498,7 +2510,7 @@
   `VMA_ASSERT` is also fired in that case.

 - Other value: Error returned by Vulkan, e.g. memory mapping failure.

 */

-VkResult vmaCheckPoolCorruption(VmaAllocator allocator, VmaPool pool);

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaCheckPoolCorruption(VmaAllocator allocator, VmaPool pool);

 

 /** \struct VmaAllocation

 \brief Represents single memory allocation.

@@ -2579,7 +2591,7 @@
 It is recommended to use vmaAllocateMemoryForBuffer(), vmaAllocateMemoryForImage(),

 vmaCreateBuffer(), vmaCreateImage() instead whenever possible.

 */

-VkResult vmaAllocateMemory(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemory(

     VmaAllocator allocator,

     const VkMemoryRequirements* pVkMemoryRequirements,

     const VmaAllocationCreateInfo* pCreateInfo,

@@ -2605,7 +2617,7 @@
 If any allocation fails, all allocations already made within this function call are also freed, so that when

 returned result is not `VK_SUCCESS`, `pAllocation` array is always entirely filled with `VK_NULL_HANDLE`.

 */

-VkResult vmaAllocateMemoryPages(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryPages(

     VmaAllocator allocator,

     const VkMemoryRequirements* pVkMemoryRequirements,

     const VmaAllocationCreateInfo* pCreateInfo,

@@ -2619,7 +2631,7 @@
 

 You should free the memory using vmaFreeMemory().

 */

-VkResult vmaAllocateMemoryForBuffer(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryForBuffer(

     VmaAllocator allocator,

     VkBuffer buffer,

     const VmaAllocationCreateInfo* pCreateInfo,

@@ -2627,7 +2639,7 @@
     VmaAllocationInfo* pAllocationInfo);

 

 /// Function similar to vmaAllocateMemoryForBuffer().

-VkResult vmaAllocateMemoryForImage(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryForImage(

     VmaAllocator allocator,

     VkImage image,

     const VmaAllocationCreateInfo* pCreateInfo,

@@ -2638,7 +2650,7 @@
 

 Passing `VK_NULL_HANDLE` as `allocation` is valid. Such function call is just skipped.

 */

-void vmaFreeMemory(

+VMA_CALL_PRE void VMA_CALL_POST vmaFreeMemory(

     VmaAllocator allocator,

     VmaAllocation allocation);

 

@@ -2652,7 +2664,7 @@
 Allocations in `pAllocations` array can come from any memory pools and types.

 Passing `VK_NULL_HANDLE` as elements of `pAllocations` array is valid. Such entries are just skipped.

 */

-void vmaFreeMemoryPages(

+VMA_CALL_PRE void VMA_CALL_POST vmaFreeMemoryPages(

     VmaAllocator allocator,

     size_t allocationCount,

     VmaAllocation* pAllocations);

@@ -2663,7 +2675,7 @@
 In current version it returns `VK_SUCCESS` only if `newSize` equals current allocation's size.

 Otherwise returns `VK_ERROR_OUT_OF_POOL_MEMORY`, indicating that allocation's size could not be changed.

 */

-VkResult vmaResizeAllocation(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaResizeAllocation(

     VmaAllocator allocator,

     VmaAllocation allocation,

     VkDeviceSize newSize);

@@ -2684,7 +2696,7 @@
   (e.g. due to defragmentation or allocation becoming lost).

 - If you just want to check if allocation is not lost, vmaTouchAllocation() will work faster.

 */

-void vmaGetAllocationInfo(

+VMA_CALL_PRE void VMA_CALL_POST vmaGetAllocationInfo(

     VmaAllocator allocator,

     VmaAllocation allocation,

     VmaAllocationInfo* pAllocationInfo);

@@ -2703,7 +2715,7 @@
 If the allocation has been created without #VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT flag,

 this function always returns `VK_TRUE`.

 */

-VkBool32 vmaTouchAllocation(

+VMA_CALL_PRE VkBool32 VMA_CALL_POST vmaTouchAllocation(

     VmaAllocator allocator,

     VmaAllocation allocation);

 

@@ -2720,7 +2732,7 @@
 allocation's `pUserData`. It is opaque, so you can use it however you want - e.g.

 as a pointer, ordinal number or some handle to you own data.

 */

-void vmaSetAllocationUserData(

+VMA_CALL_PRE void VMA_CALL_POST vmaSetAllocationUserData(

     VmaAllocator allocator,

     VmaAllocation allocation,

     void* pUserData);

@@ -2735,7 +2747,7 @@
 not bound to any image or buffer. It has size = 0. It cannot be turned into

 a real, non-empty allocation.

 */

-void vmaCreateLostAllocation(

+VMA_CALL_PRE void VMA_CALL_POST vmaCreateLostAllocation(

     VmaAllocator allocator,

     VmaAllocation* pAllocation);

 

@@ -2773,7 +2785,7 @@
 #VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT flag. Such allocations cannot be

 mapped.

 */

-VkResult vmaMapMemory(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaMapMemory(

     VmaAllocator allocator,

     VmaAllocation allocation,

     void** ppData);

@@ -2782,7 +2794,7 @@
 

 For details, see description of vmaMapMemory().

 */

-void vmaUnmapMemory(

+VMA_CALL_PRE void VMA_CALL_POST vmaUnmapMemory(

     VmaAllocator allocator,

     VmaAllocation allocation);

 

@@ -2802,7 +2814,7 @@
 If you mean whole allocation, you can pass 0 and `VK_WHOLE_SIZE`, respectively.

 Do not pass allocation's offset as `offset`!!!

 */

-void vmaFlushAllocation(VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size);

+VMA_CALL_PRE void VMA_CALL_POST vmaFlushAllocation(VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size);

 

 /** \brief Invalidates memory of given allocation.

 

@@ -2820,7 +2832,7 @@
 If you mean whole allocation, you can pass 0 and `VK_WHOLE_SIZE`, respectively.

 Do not pass allocation's offset as `offset`!!!

 */

-void vmaInvalidateAllocation(VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size);

+VMA_CALL_PRE void VMA_CALL_POST vmaInvalidateAllocation(VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size);

 

 /** \brief Checks magic number in margins around all allocations in given memory types (in both default and custom pools) in search for corruptions.

 

@@ -2838,7 +2850,7 @@
   `VMA_ASSERT` is also fired in that case.

 - Other value: Error returned by Vulkan, e.g. memory mapping failure.

 */

-VkResult vmaCheckCorruption(VmaAllocator allocator, uint32_t memoryTypeBits);

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaCheckCorruption(VmaAllocator allocator, uint32_t memoryTypeBits);

 

 /** \struct VmaDefragmentationContext

 \brief Represents Opaque object that represents started defragmentation process.

@@ -2988,7 +3000,7 @@
 For more information and important limitations regarding defragmentation, see documentation chapter:

 [Defragmentation](@ref defragmentation).

 */

-VkResult vmaDefragmentationBegin(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaDefragmentationBegin(

     VmaAllocator allocator,

     const VmaDefragmentationInfo2* pInfo,

     VmaDefragmentationStats* pStats,

@@ -2999,7 +3011,7 @@
 Use this function to finish defragmentation started by vmaDefragmentationBegin().

 It is safe to pass `context == null`. The function then does nothing.

 */

-VkResult vmaDefragmentationEnd(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaDefragmentationEnd(

     VmaAllocator allocator,

     VmaDefragmentationContext context);

 

@@ -3043,7 +3055,7 @@
 

 For more information, see [Defragmentation](@ref defragmentation) chapter.

 */

-VkResult vmaDefragment(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaDefragment(

     VmaAllocator allocator,

     VmaAllocation* pAllocations,

     size_t allocationCount,

@@ -3063,7 +3075,7 @@
 

 It is recommended to use function vmaCreateBuffer() instead of this one.

 */

-VkResult vmaBindBufferMemory(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaBindBufferMemory(

     VmaAllocator allocator,

     VmaAllocation allocation,

     VkBuffer buffer);

@@ -3078,7 +3090,7 @@
 If `pNext` is not null, #VmaAllocator object must have been created with #VMA_ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT flag.

 Otherwise the call fails.

 */

-VkResult vmaBindBufferMemory2(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaBindBufferMemory2(

     VmaAllocator allocator,

     VmaAllocation allocation,

     VkDeviceSize allocationLocalOffset,

@@ -3097,7 +3109,7 @@
 

 It is recommended to use function vmaCreateImage() instead of this one.

 */

-VkResult vmaBindImageMemory(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaBindImageMemory(

     VmaAllocator allocator,

     VmaAllocation allocation,

     VkImage image);

@@ -3112,7 +3124,7 @@
 If `pNext` is not null, #VmaAllocator object must have been created with #VMA_ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT flag.

 Otherwise the call fails.

 */

-VkResult vmaBindImageMemory2(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaBindImageMemory2(

     VmaAllocator allocator,

     VmaAllocation allocation,

     VkDeviceSize allocationLocalOffset,

@@ -3145,7 +3157,7 @@
 allocation for this buffer, just like when using

 VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT.

 */

-VkResult vmaCreateBuffer(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateBuffer(

     VmaAllocator allocator,

     const VkBufferCreateInfo* pBufferCreateInfo,

     const VmaAllocationCreateInfo* pAllocationCreateInfo,

@@ -3164,13 +3176,13 @@
 

 It it safe to pass null as buffer and/or allocation.

 */

-void vmaDestroyBuffer(

+VMA_CALL_PRE void VMA_CALL_POST vmaDestroyBuffer(

     VmaAllocator allocator,

     VkBuffer buffer,

     VmaAllocation allocation);

 

 /// Function similar to vmaCreateBuffer().

-VkResult vmaCreateImage(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateImage(

     VmaAllocator allocator,

     const VkImageCreateInfo* pImageCreateInfo,

     const VmaAllocationCreateInfo* pAllocationCreateInfo,

@@ -3189,7 +3201,7 @@
 

 It it safe to pass null as image and/or allocation.

 */

-void vmaDestroyImage(

+VMA_CALL_PRE void VMA_CALL_POST vmaDestroyImage(

     VmaAllocator allocator,

     VkImage image,

     VmaAllocation allocation);

@@ -15757,7 +15769,7 @@
 ////////////////////////////////////////////////////////////////////////////////

 // Public interface

 

-VkResult vmaCreateAllocator(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateAllocator(

     const VmaAllocatorCreateInfo* pCreateInfo,

     VmaAllocator* pAllocator)

 {

@@ -15767,7 +15779,7 @@
     return (*pAllocator)->Init(pCreateInfo);

 }

 

-void vmaDestroyAllocator(

+VMA_CALL_PRE void VMA_CALL_POST vmaDestroyAllocator(

     VmaAllocator allocator)

 {

     if(allocator != VK_NULL_HANDLE)

@@ -15778,7 +15790,7 @@
     }

 }

 

-void vmaGetPhysicalDeviceProperties(

+VMA_CALL_PRE void VMA_CALL_POST vmaGetPhysicalDeviceProperties(

     VmaAllocator allocator,

     const VkPhysicalDeviceProperties **ppPhysicalDeviceProperties)

 {

@@ -15786,7 +15798,7 @@
     *ppPhysicalDeviceProperties = &allocator->m_PhysicalDeviceProperties;

 }

 

-void vmaGetMemoryProperties(

+VMA_CALL_PRE void VMA_CALL_POST vmaGetMemoryProperties(

     VmaAllocator allocator,

     const VkPhysicalDeviceMemoryProperties** ppPhysicalDeviceMemoryProperties)

 {

@@ -15794,7 +15806,7 @@
     *ppPhysicalDeviceMemoryProperties = &allocator->m_MemProps;

 }

 

-void vmaGetMemoryTypeProperties(

+VMA_CALL_PRE void VMA_CALL_POST vmaGetMemoryTypeProperties(

     VmaAllocator allocator,

     uint32_t memoryTypeIndex,

     VkMemoryPropertyFlags* pFlags)

@@ -15804,7 +15816,7 @@
     *pFlags = allocator->m_MemProps.memoryTypes[memoryTypeIndex].propertyFlags;

 }

 

-void vmaSetCurrentFrameIndex(

+VMA_CALL_PRE void VMA_CALL_POST vmaSetCurrentFrameIndex(

     VmaAllocator allocator,

     uint32_t frameIndex)

 {

@@ -15816,7 +15828,7 @@
     allocator->SetCurrentFrameIndex(frameIndex);

 }

 

-void vmaCalculateStats(

+VMA_CALL_PRE void VMA_CALL_POST vmaCalculateStats(

     VmaAllocator allocator,

     VmaStats* pStats)

 {

@@ -15827,7 +15839,7 @@
 

 #if VMA_STATS_STRING_ENABLED

 

-void vmaBuildStatsString(

+VMA_CALL_PRE void VMA_CALL_POST vmaBuildStatsString(

     VmaAllocator allocator,

     char** ppStatsString,

     VkBool32 detailedMap)

@@ -15935,7 +15947,7 @@
     *ppStatsString = pChars;

 }

 

-void vmaFreeStatsString(

+VMA_CALL_PRE void VMA_CALL_POST vmaFreeStatsString(

     VmaAllocator allocator,

     char* pStatsString)

 {

@@ -15952,7 +15964,7 @@
 /*

 This function is not protected by any mutex because it just reads immutable data.

 */

-VkResult vmaFindMemoryTypeIndex(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaFindMemoryTypeIndex(

     VmaAllocator allocator,

     uint32_t memoryTypeBits,

     const VmaAllocationCreateInfo* pAllocationCreateInfo,

@@ -16031,7 +16043,7 @@
     return (*pMemoryTypeIndex != UINT32_MAX) ? VK_SUCCESS : VK_ERROR_FEATURE_NOT_PRESENT;

 }

 

-VkResult vmaFindMemoryTypeIndexForBufferInfo(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaFindMemoryTypeIndexForBufferInfo(

     VmaAllocator allocator,

     const VkBufferCreateInfo* pBufferCreateInfo,

     const VmaAllocationCreateInfo* pAllocationCreateInfo,

@@ -16064,7 +16076,7 @@
     return res;

 }

 

-VkResult vmaFindMemoryTypeIndexForImageInfo(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaFindMemoryTypeIndexForImageInfo(

     VmaAllocator allocator,

     const VkImageCreateInfo* pImageCreateInfo,

     const VmaAllocationCreateInfo* pAllocationCreateInfo,

@@ -16097,7 +16109,7 @@
     return res;

 }

 

-VkResult vmaCreatePool(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreatePool(

 	VmaAllocator allocator,

 	const VmaPoolCreateInfo* pCreateInfo,

 	VmaPool* pPool)

@@ -16120,7 +16132,7 @@
     return res;

 }

 

-void vmaDestroyPool(

+VMA_CALL_PRE void VMA_CALL_POST vmaDestroyPool(

     VmaAllocator allocator,

     VmaPool pool)

 {

@@ -16145,7 +16157,7 @@
     allocator->DestroyPool(pool);

 }

 

-void vmaGetPoolStats(

+VMA_CALL_PRE void VMA_CALL_POST vmaGetPoolStats(

     VmaAllocator allocator,

     VmaPool pool,

     VmaPoolStats* pPoolStats)

@@ -16157,7 +16169,7 @@
     allocator->GetPoolStats(pool, pPoolStats);

 }

 

-void vmaMakePoolAllocationsLost(

+VMA_CALL_PRE void VMA_CALL_POST vmaMakePoolAllocationsLost(

     VmaAllocator allocator,

     VmaPool pool,

     size_t* pLostAllocationCount)

@@ -16176,7 +16188,7 @@
     allocator->MakePoolAllocationsLost(pool, pLostAllocationCount);

 }

 

-VkResult vmaCheckPoolCorruption(VmaAllocator allocator, VmaPool pool)

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaCheckPoolCorruption(VmaAllocator allocator, VmaPool pool)

 {

     VMA_ASSERT(allocator && pool);

 

@@ -16187,7 +16199,7 @@
     return allocator->CheckPoolCorruption(pool);

 }

 

-VkResult vmaAllocateMemory(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemory(

     VmaAllocator allocator,

     const VkMemoryRequirements* pVkMemoryRequirements,

     const VmaAllocationCreateInfo* pCreateInfo,

@@ -16230,7 +16242,7 @@
 	return result;

 }

 

-VkResult vmaAllocateMemoryPages(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryPages(

     VmaAllocator allocator,

     const VkMemoryRequirements* pVkMemoryRequirements,

     const VmaAllocationCreateInfo* pCreateInfo,

@@ -16283,7 +16295,7 @@
 	return result;

 }

 

-VkResult vmaAllocateMemoryForBuffer(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryForBuffer(

     VmaAllocator allocator,

     VkBuffer buffer,

     const VmaAllocationCreateInfo* pCreateInfo,

@@ -16335,7 +16347,7 @@
 	return result;

 }

 

-VkResult vmaAllocateMemoryForImage(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryForImage(

     VmaAllocator allocator,

     VkImage image,

     const VmaAllocationCreateInfo* pCreateInfo,

@@ -16386,7 +16398,7 @@
 	return result;

 }

 

-void vmaFreeMemory(

+VMA_CALL_PRE void VMA_CALL_POST vmaFreeMemory(

     VmaAllocator allocator,

     VmaAllocation allocation)

 {

@@ -16415,7 +16427,7 @@
         &allocation);

 }

 

-void vmaFreeMemoryPages(

+VMA_CALL_PRE void VMA_CALL_POST vmaFreeMemoryPages(

     VmaAllocator allocator,

     size_t allocationCount,

     VmaAllocation* pAllocations)

@@ -16444,7 +16456,7 @@
     allocator->FreeMemory(allocationCount, pAllocations);

 }

 

-VkResult vmaResizeAllocation(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaResizeAllocation(

     VmaAllocator allocator,

     VmaAllocation allocation,

     VkDeviceSize newSize)

@@ -16458,7 +16470,7 @@
     return allocator->ResizeAllocation(allocation, newSize);

 }

 

-void vmaGetAllocationInfo(

+VMA_CALL_PRE void VMA_CALL_POST vmaGetAllocationInfo(

     VmaAllocator allocator,

     VmaAllocation allocation,

     VmaAllocationInfo* pAllocationInfo)

@@ -16479,7 +16491,7 @@
     allocator->GetAllocationInfo(allocation, pAllocationInfo);

 }

 

-VkBool32 vmaTouchAllocation(

+VMA_CALL_PRE VkBool32 VMA_CALL_POST vmaTouchAllocation(

     VmaAllocator allocator,

     VmaAllocation allocation)

 {

@@ -16499,7 +16511,7 @@
     return allocator->TouchAllocation(allocation);

 }

 

-void vmaSetAllocationUserData(

+VMA_CALL_PRE void VMA_CALL_POST vmaSetAllocationUserData(

     VmaAllocator allocator,

     VmaAllocation allocation,

     void* pUserData)

@@ -16521,7 +16533,7 @@
 #endif

 }

 

-void vmaCreateLostAllocation(

+VMA_CALL_PRE void VMA_CALL_POST vmaCreateLostAllocation(

     VmaAllocator allocator,

     VmaAllocation* pAllocation)

 {

@@ -16541,7 +16553,7 @@
 #endif

 }

 

-VkResult vmaMapMemory(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaMapMemory(

     VmaAllocator allocator,

     VmaAllocation allocation,

     void** ppData)

@@ -16564,7 +16576,7 @@
     return res;

 }

 

-void vmaUnmapMemory(

+VMA_CALL_PRE void VMA_CALL_POST vmaUnmapMemory(

     VmaAllocator allocator,

     VmaAllocation allocation)

 {

@@ -16584,7 +16596,7 @@
     allocator->Unmap(allocation);

 }

 

-void vmaFlushAllocation(VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size)

+VMA_CALL_PRE void VMA_CALL_POST vmaFlushAllocation(VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size)

 {

     VMA_ASSERT(allocator && allocation);

 

@@ -16604,7 +16616,7 @@
 #endif

 }

 

-void vmaInvalidateAllocation(VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size)

+VMA_CALL_PRE void VMA_CALL_POST vmaInvalidateAllocation(VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size)

 {

     VMA_ASSERT(allocator && allocation);

 

@@ -16624,7 +16636,7 @@
 #endif

 }

 

-VkResult vmaCheckCorruption(VmaAllocator allocator, uint32_t memoryTypeBits)

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaCheckCorruption(VmaAllocator allocator, uint32_t memoryTypeBits)

 {

     VMA_ASSERT(allocator);

 

@@ -16635,7 +16647,7 @@
     return allocator->CheckCorruption(memoryTypeBits);

 }

 

-VkResult vmaDefragment(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaDefragment(

     VmaAllocator allocator,

     VmaAllocation* pAllocations,

     size_t allocationCount,

@@ -16670,7 +16682,7 @@
     return res;

 }

 

-VkResult vmaDefragmentationBegin(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaDefragmentationBegin(

     VmaAllocator allocator,

     const VmaDefragmentationInfo2* pInfo,

     VmaDefragmentationStats* pStats,

@@ -16706,7 +16718,7 @@
     return res;

 }

 

-VkResult vmaDefragmentationEnd(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaDefragmentationEnd(

     VmaAllocator allocator,

     VmaDefragmentationContext context)

 {

@@ -16734,7 +16746,7 @@
     }

 }

 

-VkResult vmaBindBufferMemory(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaBindBufferMemory(

     VmaAllocator allocator,

     VmaAllocation allocation,

     VkBuffer buffer)

@@ -16748,7 +16760,7 @@
     return allocator->BindBufferMemory(allocation, 0, buffer, VMA_NULL);

 }

 

-VkResult vmaBindBufferMemory2(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaBindBufferMemory2(

     VmaAllocator allocator,

     VmaAllocation allocation,

     VkDeviceSize allocationLocalOffset,

@@ -16764,7 +16776,7 @@
     return allocator->BindBufferMemory(allocation, allocationLocalOffset, buffer, pNext);

 }

 

-VkResult vmaBindImageMemory(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaBindImageMemory(

     VmaAllocator allocator,

     VmaAllocation allocation,

     VkImage image)

@@ -16778,7 +16790,7 @@
     return allocator->BindImageMemory(allocation, 0, image, VMA_NULL);

 }

 

-VkResult vmaBindImageMemory2(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaBindImageMemory2(

     VmaAllocator allocator,

     VmaAllocation allocation,

     VkDeviceSize allocationLocalOffset,

@@ -16794,7 +16806,7 @@
         return allocator->BindImageMemory(allocation, allocationLocalOffset, image, pNext);

 }

 

-VkResult vmaCreateBuffer(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateBuffer(

     VmaAllocator allocator,

     const VkBufferCreateInfo* pBufferCreateInfo,

     const VmaAllocationCreateInfo* pAllocationCreateInfo,

@@ -16907,7 +16919,7 @@
     return res;

 }

 

-void vmaDestroyBuffer(

+VMA_CALL_PRE void VMA_CALL_POST vmaDestroyBuffer(

     VmaAllocator allocator,

     VkBuffer buffer,

     VmaAllocation allocation)

@@ -16945,7 +16957,7 @@
     }

 }

 

-VkResult vmaCreateImage(

+VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateImage(

     VmaAllocator allocator,

     const VkImageCreateInfo* pImageCreateInfo,

     const VmaAllocationCreateInfo* pAllocationCreateInfo,

@@ -17047,7 +17059,7 @@
     return res;

 }

 

-void vmaDestroyImage(

+VMA_CALL_PRE void VMA_CALL_POST vmaDestroyImage(

     VmaAllocator allocator,

     VkImage image,

     VmaAllocation allocation)