From 189f4ebf1fca9f200ce1562ff182a67bdb5c19b8 Mon Sep 17 00:00:00 2001 From: scribam Date: Mon, 31 May 2021 10:28:16 +0200 Subject: [PATCH] Support BSD operating systems --- VulkanHppGenerator.cpp | 12 ++++++------ vulkan/vulkan.hpp | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/VulkanHppGenerator.cpp b/VulkanHppGenerator.cpp index b0c9d0b..fb3054f 100644 --- a/VulkanHppGenerator.cpp +++ b/VulkanHppGenerator.cpp @@ -2059,7 +2059,7 @@ void VulkanHppGenerator::appendDispatchLoaderDynamic( std::string & str ) { if ( !vulkanLibraryName.empty() ) { -# if defined( __linux__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined(__Fuchsia__) +# if defined( __unix__ ) || 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() ); @@ -2069,7 +2069,7 @@ void VulkanHppGenerator::appendDispatchLoaderDynamic( std::string & str ) } else { -# if defined( __linux__ ) || defined( __QNXNTO__ ) || defined(__Fuchsia__) +# if defined( __unix__ ) || defined( __QNXNTO__ ) || defined(__Fuchsia__) m_library = dlopen( "libvulkan.so", RTLD_NOW | RTLD_LOCAL ); if ( m_library == nullptr ) { @@ -2112,7 +2112,7 @@ void VulkanHppGenerator::appendDispatchLoaderDynamic( std::string & str ) { if ( m_library ) { -# if defined( __linux__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined(__Fuchsia__) +# if defined( __unix__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined(__Fuchsia__) dlclose( m_library ); # elif defined( _WIN32 ) ::FreeLibrary( m_library ); @@ -2125,7 +2125,7 @@ void VulkanHppGenerator::appendDispatchLoaderDynamic( std::string & str ) template T getProcAddress( const char* function ) const VULKAN_HPP_NOEXCEPT { -# if defined( __linux__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined(__Fuchsia__) +# if defined( __unix__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined(__Fuchsia__) return (T)dlsym( m_library, function ); # elif defined( _WIN32 ) return (T)::GetProcAddress( m_library, function ); @@ -2137,7 +2137,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__ ) || defined(__Fuchsia__) +# if defined( __unix__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined(__Fuchsia__) void * m_library; # elif defined( _WIN32 ) ::HINSTANCE m_library; @@ -16277,7 +16277,7 @@ int main( int argc, char ** argv ) #endif #if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL == 1 -# if defined( __linux__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined(__Fuchsia__) +# if defined( __unix__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined(__Fuchsia__) # include # elif defined( _WIN32 ) typedef struct HINSTANCE__ * HINSTANCE; diff --git a/vulkan/vulkan.hpp b/vulkan/vulkan.hpp index f98ad4c..2f8dbf0 100644 --- a/vulkan/vulkan.hpp +++ b/vulkan/vulkan.hpp @@ -67,7 +67,7 @@ #endif #if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL == 1 -# if defined( __linux__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined( __Fuchsia__ ) +# if defined( __unix__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined( __Fuchsia__ ) # include # elif defined( _WIN32 ) typedef struct HINSTANCE__ * HINSTANCE; @@ -123450,7 +123450,7 @@ namespace VULKAN_HPP_NAMESPACE { if ( !vulkanLibraryName.empty() ) { -# if defined( __linux__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined( __Fuchsia__ ) +# if defined( __unix__ ) || 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() ); @@ -123460,7 +123460,7 @@ namespace VULKAN_HPP_NAMESPACE } else { -# if defined( __linux__ ) || defined( __QNXNTO__ ) || defined( __Fuchsia__ ) +# if defined( __unix__ ) || defined( __QNXNTO__ ) || defined( __Fuchsia__ ) m_library = dlopen( "libvulkan.so", RTLD_NOW | RTLD_LOCAL ); if ( m_library == nullptr ) { @@ -123504,7 +123504,7 @@ namespace VULKAN_HPP_NAMESPACE { if ( m_library ) { -# if defined( __linux__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined( __Fuchsia__ ) +# if defined( __unix__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined( __Fuchsia__ ) dlclose( m_library ); # elif defined( _WIN32 ) ::FreeLibrary( m_library ); @@ -123517,7 +123517,7 @@ namespace VULKAN_HPP_NAMESPACE template T getProcAddress( const char * function ) const VULKAN_HPP_NOEXCEPT { -# if defined( __linux__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined( __Fuchsia__ ) +# if defined( __unix__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined( __Fuchsia__ ) return (T)dlsym( m_library, function ); # elif defined( _WIN32 ) return ( T )::GetProcAddress( m_library, function ); @@ -123532,7 +123532,7 @@ namespace VULKAN_HPP_NAMESPACE } private: -# if defined( __linux__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined( __Fuchsia__ ) +# if defined( __unix__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined( __Fuchsia__ ) void * m_library; # elif defined( _WIN32 ) ::HINSTANCE m_library;