From 188329cc4f102aabc7b39d0d8d433158dd761b4a Mon Sep 17 00:00:00 2001 From: John Rosasco Date: Mon, 12 Apr 2021 11:27:39 -0700 Subject: [PATCH 1/2] Add Fuchsia platform defines --- VulkanHppGenerator.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index 4769bd2..e777700 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -2075,7 +2075,7 @@ void VulkanHppGenerator::appendDispatchLoaderDynamic( std::string & str ) { if ( !vulkanLibraryName.empty() ) { -# if defined( __linux__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) +# if defined( __linux__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined(__Fuchsia__) m_library = dlopen( vulkanLibraryName.c_str(), RTLD_NOW | RTLD_LOCAL ); # elif defined( _WIN32 ) m_library = ::LoadLibraryA( vulkanLibraryName.c_str() ); @@ -2085,7 +2085,7 @@ void VulkanHppGenerator::appendDispatchLoaderDynamic( std::string & str ) } else { -# if defined( __linux__ ) || defined( __QNXNTO__ ) +# if defined( __linux__ ) || defined( __QNXNTO__ ) || defined(__Fuchsia__) m_library = dlopen( "libvulkan.so", RTLD_NOW | RTLD_LOCAL ); if ( m_library == nullptr ) { @@ -2128,7 +2128,7 @@ void VulkanHppGenerator::appendDispatchLoaderDynamic( std::string & str ) { if ( m_library ) { -# if defined( __linux__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) +# if defined( __linux__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined(__Fuchsia__) dlclose( m_library ); # elif defined( _WIN32 ) ::FreeLibrary( m_library ); @@ -2141,7 +2141,7 @@ void VulkanHppGenerator::appendDispatchLoaderDynamic( std::string & str ) template T getProcAddress( const char* function ) const VULKAN_HPP_NOEXCEPT { -# if defined( __linux__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) +# if defined( __linux__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined(__Fuchsia__) return (T)dlsym( m_library, function ); # elif defined( _WIN32 ) return (T)::GetProcAddress( m_library, function ); @@ -2153,7 +2153,7 @@ void VulkanHppGenerator::appendDispatchLoaderDynamic( std::string & str ) bool success() const VULKAN_HPP_NOEXCEPT { return m_library != nullptr; } private: -# if defined( __linux__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) +# if defined( __linux__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined(__Fuchsia__) void * m_library; # elif defined( _WIN32 ) ::HINSTANCE m_library; @@ -15690,7 +15690,7 @@ int main( int argc, char ** argv ) #endif #if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL == 1 -# if defined( __linux__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) +# if defined( __linux__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined(__Fuchsia__) # include # elif defined( _WIN32 ) typedef struct HINSTANCE__ * HINSTANCE; From d790fb8c7646bc1452fdbb90b1189971e24a54c0 Mon Sep 17 00:00:00 2001 From: John Rosasco Date: Mon, 12 Apr 2021 11:40:41 -0700 Subject: [PATCH 2/2] Add std::move to createResult --- VulkanHppGenerator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index e777700..cb2aabc 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -15921,7 +15921,7 @@ namespace std throwResultException( result, message ); } #endif - return ResultValue( result, data ); + return ResultValue( result, std::move( data ) ); } #ifndef VULKAN_HPP_NO_SMART_HANDLE