diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index 6212277..7afe7c2 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -1811,7 +1811,7 @@ void VulkanHppGenerator::appendEnums( std::string & str ) const { str += R"( template - struct [[deprecated("vk::cpp_type is deprecated. Use vk::CppType instead.")]] cpp_type + struct VULKAN_HPP_DEPRECATED("vk::cpp_type is deprecated. Use vk::CppType instead.") cpp_type {}; )"; } @@ -3267,7 +3267,7 @@ ${commands} static_assert( sizeof( ${className} ) == sizeof( Vk${className} ), "handle and wrapper have different size!" ); template <> - struct [[deprecated("vk::cpp_type is deprecated. Use vk::CppType instead.")]] cpp_type + struct VULKAN_HPP_DEPRECATED("vk::cpp_type is deprecated. Use vk::CppType instead.") cpp_type { using type = ${className}; }; @@ -7612,6 +7612,15 @@ int main( int argc, char ** argv ) # endif #endif +#ifdef __has_cpp_attribute // Check if __has_cpp_attribute is present +# if __has_cpp_attribute(deprecated) // Check for an attribute +# define VULKAN_HPP_DEPRECATED(msg) [[deprecated(msg)]] +# endif +#endif +#ifndef VULKAN_HPP_DEPRECATED +# define VULKAN_HPP_DEPRECATED( msg ) +#endif + #if !defined(VULKAN_HPP_NAMESPACE) #define VULKAN_HPP_NAMESPACE vk #endif diff --git a/vulkan/vulkan.hpp b/vulkan/vulkan.hpp index ce7c4de..93cb254 100644 --- a/vulkan/vulkan.hpp +++ b/vulkan/vulkan.hpp @@ -171,6 +171,15 @@ static_assert( VK_HEADER_VERSION == 137, "Wrong VK_HEADER_VERSION!" ); # endif #endif +#ifdef __has_cpp_attribute // Check if __has_cpp_attribute is present +# if __has_cpp_attribute( deprecated ) // Check for an attribute +# define VULKAN_HPP_DEPRECATED( msg ) [[deprecated( msg )]] +# endif +#endif +#ifndef VULKAN_HPP_DEPRECATED +# define VULKAN_HPP_DEPRECATED( msg ) +#endif + #if !defined( VULKAN_HPP_NAMESPACE ) # define VULKAN_HPP_NAMESPACE vk #endif @@ -7464,7 +7473,8 @@ namespace VULKAN_HPP_NAMESPACE } template - struct [[deprecated( "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type{}; + struct VULKAN_HPP_DEPRECATED( "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type + {}; enum class PeerMemoryFeatureFlagBits : VkPeerMemoryFeatureFlags { @@ -16748,7 +16758,8 @@ namespace VULKAN_HPP_NAMESPACE static_assert( sizeof( SurfaceKHR ) == sizeof( VkSurfaceKHR ), "handle and wrapper have different size!" ); template <> - struct [[deprecated( "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( + "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = SurfaceKHR; }; @@ -16833,8 +16844,8 @@ namespace VULKAN_HPP_NAMESPACE "handle and wrapper have different size!" ); template <> - struct [[deprecated( - "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( + "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = DebugReportCallbackEXT; }; @@ -16919,8 +16930,8 @@ namespace VULKAN_HPP_NAMESPACE "handle and wrapper have different size!" ); template <> - struct [[deprecated( - "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( + "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = DebugUtilsMessengerEXT; }; @@ -17000,7 +17011,8 @@ namespace VULKAN_HPP_NAMESPACE static_assert( sizeof( DisplayKHR ) == sizeof( VkDisplayKHR ), "handle and wrapper have different size!" ); template <> - struct [[deprecated( "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( + "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = DisplayKHR; }; @@ -17081,7 +17093,8 @@ namespace VULKAN_HPP_NAMESPACE static_assert( sizeof( SwapchainKHR ) == sizeof( VkSwapchainKHR ), "handle and wrapper have different size!" ); template <> - struct [[deprecated( "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( + "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = SwapchainKHR; }; @@ -17160,7 +17173,8 @@ namespace VULKAN_HPP_NAMESPACE static_assert( sizeof( Semaphore ) == sizeof( VkSemaphore ), "handle and wrapper have different size!" ); template <> - struct [[deprecated( "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( + "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = Semaphore; }; @@ -17239,7 +17253,7 @@ namespace VULKAN_HPP_NAMESPACE static_assert( sizeof( Fence ) == sizeof( VkFence ), "handle and wrapper have different size!" ); template <> - struct [[deprecated( "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = Fence; }; @@ -17327,8 +17341,8 @@ namespace VULKAN_HPP_NAMESPACE "handle and wrapper have different size!" ); template <> - struct [[deprecated( - "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( + "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = PerformanceConfigurationINTEL; }; @@ -17407,7 +17421,8 @@ namespace VULKAN_HPP_NAMESPACE static_assert( sizeof( QueryPool ) == sizeof( VkQueryPool ), "handle and wrapper have different size!" ); template <> - struct [[deprecated( "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( + "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = QueryPool; }; @@ -17486,7 +17501,7 @@ namespace VULKAN_HPP_NAMESPACE static_assert( sizeof( Buffer ) == sizeof( VkBuffer ), "handle and wrapper have different size!" ); template <> - struct [[deprecated( "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = Buffer; }; @@ -17567,7 +17582,8 @@ namespace VULKAN_HPP_NAMESPACE static_assert( sizeof( PipelineLayout ) == sizeof( VkPipelineLayout ), "handle and wrapper have different size!" ); template <> - struct [[deprecated( "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( + "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = PipelineLayout; }; @@ -17648,7 +17664,8 @@ namespace VULKAN_HPP_NAMESPACE static_assert( sizeof( DescriptorSet ) == sizeof( VkDescriptorSet ), "handle and wrapper have different size!" ); template <> - struct [[deprecated( "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( + "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = DescriptorSet; }; @@ -17727,7 +17744,7 @@ namespace VULKAN_HPP_NAMESPACE static_assert( sizeof( Pipeline ) == sizeof( VkPipeline ), "handle and wrapper have different size!" ); template <> - struct [[deprecated( "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = Pipeline; }; @@ -17806,7 +17823,8 @@ namespace VULKAN_HPP_NAMESPACE static_assert( sizeof( ImageView ) == sizeof( VkImageView ), "handle and wrapper have different size!" ); template <> - struct [[deprecated( "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( + "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = ImageView; }; @@ -17885,7 +17903,7 @@ namespace VULKAN_HPP_NAMESPACE static_assert( sizeof( Image ) == sizeof( VkImage ), "handle and wrapper have different size!" ); template <> - struct [[deprecated( "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = Image; }; @@ -17971,8 +17989,8 @@ namespace VULKAN_HPP_NAMESPACE "handle and wrapper have different size!" ); template <> - struct [[deprecated( - "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( + "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = AccelerationStructureKHR; }; @@ -18059,8 +18077,8 @@ namespace VULKAN_HPP_NAMESPACE "handle and wrapper have different size!" ); template <> - struct [[deprecated( - "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( + "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = DescriptorUpdateTemplate; }; @@ -18140,7 +18158,7 @@ namespace VULKAN_HPP_NAMESPACE static_assert( sizeof( Event ) == sizeof( VkEvent ), "handle and wrapper have different size!" ); template <> - struct [[deprecated( "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = Event; }; @@ -19345,7 +19363,8 @@ namespace VULKAN_HPP_NAMESPACE static_assert( sizeof( CommandBuffer ) == sizeof( VkCommandBuffer ), "handle and wrapper have different size!" ); template <> - struct [[deprecated( "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( + "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = CommandBuffer; }; @@ -19426,7 +19445,8 @@ namespace VULKAN_HPP_NAMESPACE static_assert( sizeof( DeviceMemory ) == sizeof( VkDeviceMemory ), "handle and wrapper have different size!" ); template <> - struct [[deprecated( "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( + "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = DeviceMemory; }; @@ -19506,7 +19526,8 @@ namespace VULKAN_HPP_NAMESPACE static_assert( sizeof( BufferView ) == sizeof( VkBufferView ), "handle and wrapper have different size!" ); template <> - struct [[deprecated( "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( + "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = BufferView; }; @@ -19587,7 +19608,8 @@ namespace VULKAN_HPP_NAMESPACE static_assert( sizeof( CommandPool ) == sizeof( VkCommandPool ), "handle and wrapper have different size!" ); template <> - struct [[deprecated( "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( + "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = CommandPool; }; @@ -19668,7 +19690,8 @@ namespace VULKAN_HPP_NAMESPACE static_assert( sizeof( PipelineCache ) == sizeof( VkPipelineCache ), "handle and wrapper have different size!" ); template <> - struct [[deprecated( "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( + "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = PipelineCache; }; @@ -19753,8 +19776,8 @@ namespace VULKAN_HPP_NAMESPACE "handle and wrapper have different size!" ); template <> - struct [ - [deprecated( "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( + "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = DeferredOperationKHR; }; @@ -19836,7 +19859,8 @@ namespace VULKAN_HPP_NAMESPACE static_assert( sizeof( DescriptorPool ) == sizeof( VkDescriptorPool ), "handle and wrapper have different size!" ); template <> - struct [[deprecated( "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( + "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = DescriptorPool; }; @@ -19920,8 +19944,8 @@ namespace VULKAN_HPP_NAMESPACE "handle and wrapper have different size!" ); template <> - struct [ - [deprecated( "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( + "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = DescriptorSetLayout; }; @@ -20002,7 +20026,8 @@ namespace VULKAN_HPP_NAMESPACE static_assert( sizeof( Framebuffer ) == sizeof( VkFramebuffer ), "handle and wrapper have different size!" ); template <> - struct [[deprecated( "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( + "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = Framebuffer; }; @@ -20088,8 +20113,8 @@ namespace VULKAN_HPP_NAMESPACE "handle and wrapper have different size!" ); template <> - struct [[deprecated( - "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( + "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = IndirectCommandsLayoutNV; }; @@ -20169,7 +20194,8 @@ namespace VULKAN_HPP_NAMESPACE static_assert( sizeof( RenderPass ) == sizeof( VkRenderPass ), "handle and wrapper have different size!" ); template <> - struct [[deprecated( "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( + "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = RenderPass; }; @@ -20248,7 +20274,7 @@ namespace VULKAN_HPP_NAMESPACE static_assert( sizeof( Sampler ) == sizeof( VkSampler ), "handle and wrapper have different size!" ); template <> - struct [[deprecated( "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = Sampler; }; @@ -20333,8 +20359,8 @@ namespace VULKAN_HPP_NAMESPACE "handle and wrapper have different size!" ); template <> - struct [[deprecated( - "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( + "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = SamplerYcbcrConversion; }; @@ -20416,7 +20442,8 @@ namespace VULKAN_HPP_NAMESPACE static_assert( sizeof( ShaderModule ) == sizeof( VkShaderModule ), "handle and wrapper have different size!" ); template <> - struct [[deprecated( "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( + "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = ShaderModule; }; @@ -20500,8 +20527,8 @@ namespace VULKAN_HPP_NAMESPACE "handle and wrapper have different size!" ); template <> - struct [ - [deprecated( "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( + "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = ValidationCacheEXT; }; @@ -20668,7 +20695,7 @@ namespace VULKAN_HPP_NAMESPACE static_assert( sizeof( Queue ) == sizeof( VkQueue ), "handle and wrapper have different size!" ); template <> - struct [[deprecated( "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = Queue; }; @@ -24234,7 +24261,7 @@ namespace VULKAN_HPP_NAMESPACE static_assert( sizeof( Device ) == sizeof( VkDevice ), "handle and wrapper have different size!" ); template <> - struct [[deprecated( "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = Device; }; @@ -24315,7 +24342,8 @@ namespace VULKAN_HPP_NAMESPACE static_assert( sizeof( DisplayModeKHR ) == sizeof( VkDisplayModeKHR ), "handle and wrapper have different size!" ); template <> - struct [[deprecated( "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( + "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = DisplayModeKHR; }; @@ -25364,7 +25392,8 @@ namespace VULKAN_HPP_NAMESPACE static_assert( sizeof( PhysicalDevice ) == sizeof( VkPhysicalDevice ), "handle and wrapper have different size!" ); template <> - struct [[deprecated( "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( + "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = PhysicalDevice; }; @@ -25957,7 +25986,7 @@ namespace VULKAN_HPP_NAMESPACE static_assert( sizeof( Instance ) == sizeof( VkInstance ), "handle and wrapper have different size!" ); template <> - struct [[deprecated( "vk::cpp_type is deprecated. Use vk::CppType instead." )]] cpp_type + struct VULKAN_HPP_DEPRECATED( "vk::cpp_type is deprecated. Use vk::CppType instead." ) cpp_type { using type = Instance; };