mirror of
https://github.com/KhronosGroup/Vulkan-Hpp.git
synced 2024-10-14 16:32:17 +00:00
Merge pull request #933 from rosasco-wk/master
Add Fuchsia platform defines
This commit is contained in:
commit
bd7a3e8ab7
@ -2075,7 +2075,7 @@ void VulkanHppGenerator::appendDispatchLoaderDynamic( std::string & str )
|
|||||||
{
|
{
|
||||||
if ( !vulkanLibraryName.empty() )
|
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 );
|
m_library = dlopen( vulkanLibraryName.c_str(), RTLD_NOW | RTLD_LOCAL );
|
||||||
# elif defined( _WIN32 )
|
# elif defined( _WIN32 )
|
||||||
m_library = ::LoadLibraryA( vulkanLibraryName.c_str() );
|
m_library = ::LoadLibraryA( vulkanLibraryName.c_str() );
|
||||||
@ -2085,7 +2085,7 @@ void VulkanHppGenerator::appendDispatchLoaderDynamic( std::string & str )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
# if defined( __linux__ ) || defined( __QNXNTO__ )
|
# if defined( __linux__ ) || defined( __QNXNTO__ ) || defined(__Fuchsia__)
|
||||||
m_library = dlopen( "libvulkan.so", RTLD_NOW | RTLD_LOCAL );
|
m_library = dlopen( "libvulkan.so", RTLD_NOW | RTLD_LOCAL );
|
||||||
if ( m_library == nullptr )
|
if ( m_library == nullptr )
|
||||||
{
|
{
|
||||||
@ -2128,7 +2128,7 @@ void VulkanHppGenerator::appendDispatchLoaderDynamic( std::string & str )
|
|||||||
{
|
{
|
||||||
if ( m_library )
|
if ( m_library )
|
||||||
{
|
{
|
||||||
# if defined( __linux__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ )
|
# if defined( __linux__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined(__Fuchsia__)
|
||||||
dlclose( m_library );
|
dlclose( m_library );
|
||||||
# elif defined( _WIN32 )
|
# elif defined( _WIN32 )
|
||||||
::FreeLibrary( m_library );
|
::FreeLibrary( m_library );
|
||||||
@ -2141,7 +2141,7 @@ void VulkanHppGenerator::appendDispatchLoaderDynamic( std::string & str )
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
T getProcAddress( const char* function ) const VULKAN_HPP_NOEXCEPT
|
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 );
|
return (T)dlsym( m_library, function );
|
||||||
# elif defined( _WIN32 )
|
# elif defined( _WIN32 )
|
||||||
return (T)::GetProcAddress( m_library, function );
|
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; }
|
bool success() const VULKAN_HPP_NOEXCEPT { return m_library != nullptr; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
# if defined( __linux__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ )
|
# if defined( __linux__ ) || defined( __APPLE__ ) || defined( __QNXNTO__ ) || defined(__Fuchsia__)
|
||||||
void * m_library;
|
void * m_library;
|
||||||
# elif defined( _WIN32 )
|
# elif defined( _WIN32 )
|
||||||
::HINSTANCE m_library;
|
::HINSTANCE m_library;
|
||||||
@ -15765,7 +15765,7 @@ int main( int argc, char ** argv )
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if VULKAN_HPP_ENABLE_DYNAMIC_LOADER_TOOL == 1
|
#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 <dlfcn.h>
|
# include <dlfcn.h>
|
||||||
# elif defined( _WIN32 )
|
# elif defined( _WIN32 )
|
||||||
typedef struct HINSTANCE__ * HINSTANCE;
|
typedef struct HINSTANCE__ * HINSTANCE;
|
||||||
@ -16005,7 +16005,7 @@ namespace std
|
|||||||
throwResultException( result, message );
|
throwResultException( result, message );
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return ResultValue<T>( result, data );
|
return ResultValue<T>( result, std::move( data ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef VULKAN_HPP_NO_SMART_HANDLE
|
#ifndef VULKAN_HPP_NO_SMART_HANDLE
|
||||||
|
Loading…
Reference in New Issue
Block a user