From bdbf7fef283481f57da616ab8069ebb66983f68b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=BC=C3=9Fenbach?= Date: Wed, 1 Feb 2017 19:15:52 +0100 Subject: [PATCH] Prevent warning on multiple defined macro VULKAN_HPP_TYPESAFE_CONVERSION in 32 bit. (#71) --- VulkanHppGenerator.cpp | 4 +++- vulkan/vulkan.hpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index 3a23330..39b9da8 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -3567,7 +3567,9 @@ void writeTypesafeCheck(std::ofstream & ofs, std::string const& typesafeCheck) ofs << "// 32-bit vulkan is not typesafe for handles, so don't allow copy constructors on this platform by default." << std::endl << "// To enable this feature on 32-bit platforms please define VULKAN_HPP_TYPESAFE_CONVERSION" << std::endl << typesafeCheck << std::endl - << "#define VULKAN_HPP_TYPESAFE_CONVERSION 1" << std::endl + << "# if !defined( VULKAN_HPP_TYPESAFE_CONVERSION )" << std::endl + << "# define VULKAN_HPP_TYPESAFE_CONVERSION" << std::endl + << "# endif" << std::endl << "#endif" << std::endl << std::endl; } diff --git a/vulkan/vulkan.hpp b/vulkan/vulkan.hpp index 33b9b92..f0cfd9e 100644 --- a/vulkan/vulkan.hpp +++ b/vulkan/vulkan.hpp @@ -46,7 +46,9 @@ static_assert( VK_HEADER_VERSION == 39 , "Wrong VK_HEADER_VERSION!" ); // 32-bit vulkan is not typesafe for handles, so don't allow copy constructors on this platform by default. // To enable this feature on 32-bit platforms please define VULKAN_HPP_TYPESAFE_CONVERSION #if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) -#define VULKAN_HPP_TYPESAFE_CONVERSION 1 +# if !defined( VULKAN_HPP_TYPESAFE_CONVERSION ) +# define VULKAN_HPP_TYPESAFE_CONVERSION +# endif #endif #if !defined(VULKAN_HPP_HAS_UNRESTRICTED_UNIONS)