Add IsLittleEndian check to Utils
This commit is contained in:
2
3rdParty/glfw/CMakeLists.txt
vendored
2
3rdParty/glfw/CMakeLists.txt
vendored
@@ -6,4 +6,6 @@ FetchContent_Declare(
|
||||
GIT_TAG 3.3.2
|
||||
GIT_SHALLOW TRUE
|
||||
)
|
||||
set(GLFW_BUILD_EXAMPLES OFF)
|
||||
set(GLFW_BUILD_TESTS OFF)
|
||||
FetchContent_MakeAvailable(glfw)
|
||||
@@ -91,5 +91,14 @@ namespace openVulkanoCpp
|
||||
}
|
||||
return log;
|
||||
}
|
||||
|
||||
static bool IsLittleEndian()
|
||||
{ //TODO update with cpp20
|
||||
const int value { 0x01 };
|
||||
const void * address { static_cast<const void *>(&value) };
|
||||
const unsigned char * least_significant_address { static_cast<const unsigned char *>(address) };
|
||||
|
||||
return (*least_significant_address == 0x01);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user