~ WIP port emscripen (WebGL)
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
#define Lseek lseek
|
||||
#define Open_def open
|
||||
#define Ftruncate ftruncate
|
||||
#elif defined(NAZARA_PLATFORM_LINUX)
|
||||
#elif defined(NAZARA_PLATFORM_LINUX) || defined(NAZARA_PLATFORM_WEB)
|
||||
#define Stat stat64
|
||||
#define Fstat fstat64
|
||||
#define Off_t off64_t
|
||||
|
||||
@@ -5,12 +5,13 @@
|
||||
#include <Nazara/Core/Posix/HardwareInfoImpl.hpp>
|
||||
#include <unistd.h>
|
||||
#include <Nazara/Core/Debug.hpp>
|
||||
#include <Nazara/Core/Error.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
void HardwareInfoImpl::Cpuid(UInt32 functionId, UInt32 subFunctionId, UInt32 registers[4])
|
||||
{
|
||||
#if defined(NAZARA_COMPILER_CLANG) || defined(NAZARA_COMPILER_GCC) || defined(NAZARA_COMPILER_INTEL)
|
||||
#if (defined(NAZARA_COMPILER_CLANG) || defined(NAZARA_COMPILER_GCC) || defined(NAZARA_COMPILER_INTEL)) && !defined(NAZARA_PLATFORM_WEB)
|
||||
// https://en.wikipedia.org/wiki/CPUID
|
||||
asm volatile(
|
||||
#ifdef NAZARA_PLATFORM_x64
|
||||
@@ -50,6 +51,8 @@ namespace Nz
|
||||
{
|
||||
#ifdef NAZARA_PLATFORM_x64
|
||||
return true; // cpuid is always supported on x64 arch
|
||||
#elif defined(NAZARA_PLATFORM_WEB)
|
||||
return false;
|
||||
#else
|
||||
#if defined(NAZARA_COMPILER_CLANG) || defined(NAZARA_COMPILER_GCC) || defined(NAZARA_COMPILER_INTEL)
|
||||
int supported;
|
||||
|
||||
@@ -135,7 +135,7 @@ namespace Nz
|
||||
* Reads the stream until a line separator or the end of the stream is found.
|
||||
*
|
||||
* If lineSize does not equal zero, it represents the maximum character count to be read from the stream.
|
||||
*
|
||||
*
|
||||
* \param lineSize Maximum number of characters to read, or zero for no limit
|
||||
*
|
||||
* \return Line read from file
|
||||
@@ -264,7 +264,7 @@ namespace Nz
|
||||
#if defined(NAZARA_PLATFORM_WINDOWS)
|
||||
std::string temp(string);
|
||||
ReplaceStr(temp, "\n", "\r\n");
|
||||
#elif defined(NAZARA_PLATFORM_LINUX)
|
||||
#elif defined(NAZARA_PLATFORM_LINUX) || defined(NAZARA_PLATFORM_WEB)
|
||||
std::string_view temp(string);
|
||||
// Nothing to do
|
||||
#elif defined(NAZARA_PLATFORM_MACOS)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#ifdef NAZARA_PLATFORM_WINDOWS
|
||||
#include <objbase.h>
|
||||
#elif defined(NAZARA_PLATFORM_LINUX) || defined(NAZARA_PLATFORM_MACOS)
|
||||
#elif defined(NAZARA_PLATFORM_LINUX) || defined(NAZARA_PLATFORM_MACOS) || defined(NAZARA_PLATFORM_WEB)
|
||||
#include <uuid/uuid.h>
|
||||
#endif
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace Nz
|
||||
|
||||
for (unsigned int i = 0; i < 8; ++i)
|
||||
uuid[8 + i] = static_cast<UInt8>(id.Data4[i]);
|
||||
#elif defined(NAZARA_PLATFORM_LINUX) || defined(NAZARA_PLATFORM_MACOS)
|
||||
#elif defined(NAZARA_PLATFORM_LINUX) || defined(NAZARA_PLATFORM_MACOS) || defined(NAZARA_PLATFORM_WEB)
|
||||
uuid_t id;
|
||||
uuid_generate(id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user