Fix emscripten build.

This commit is contained in:
Martín Lucas Golini
2024-11-02 14:44:32 -03:00
parent 71a38e81be
commit f6edbd75e6
5 changed files with 15 additions and 7 deletions

View File

@@ -33,8 +33,15 @@ class EE_API PropertySpecification {
protected:
friend class PropertyDefinition;
// Investigate why robin_hood::unordered_flat_map fails with wasm build!
#if EE_PLATFORM == EE_PLATFORM_EMSCRIPTEN
std::unordered_map<Uint32, std::shared_ptr<PropertyDefinition>> mProperties;
std::unordered_map<Uint32, std::shared_ptr<ShorthandDefinition>> mShorthands;
#else
UnorderedMap<Uint32, std::shared_ptr<PropertyDefinition>> mProperties;
UnorderedMap<Uint32, std::shared_ptr<ShorthandDefinition>> mShorthands;
#endif
const PropertyDefinition* addPropertyAlias( Uint32 aliasId, const PropertyDefinition* propDef );
};

View File

@@ -14,7 +14,8 @@
#include <limits>
#include <random>
#if __GNUC__ >= 11 || ( __clang__ && __clang_major__ >= 12 )
#if ( __GNUC__ >= 11 || ( __clang__ && __clang_major__ >= 12 ) ) && \
EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN
#define STD_SUPPORTS_FIXED_TO_CHARS
#endif

View File

@@ -366,8 +366,7 @@ bool TextureAtlasLoader::updateTextureAtlas() {
fs.write( reinterpret_cast<char*>( tTexHdr ), sizeof( sTextureHdr ) );
fs.write( reinterpret_cast<char*>( &tTexAtlas->TextureRegions[0] ),
sizeof( sTextureRegionHdr ) *
(std::streamsize)tTexAtlas->TextureRegions.size() );
sizeof( sTextureRegionHdr ) * (std::size_t)tTexAtlas->TextureRegions.size() );
}
return true;

View File

@@ -727,7 +727,7 @@ void TexturePacker::saveTextureRegions() {
if ( tTextureRegionsHdr.size() )
fs.write( reinterpret_cast<const char*>( &tTextureRegionsHdr[0] ),
sizeof( sTextureRegionHdr ) * (std::streamsize)tTextureRegionsHdr.size() );
sizeof( sTextureRegionHdr ) * tTextureRegionsHdr.size() );
}
}

View File

@@ -1,4 +1,5 @@
#include "version.hpp"
#include <cinttypes>
#include <eepp/core/string.hpp>
namespace ecode {
@@ -13,12 +14,12 @@ Uint64 Version::getVersionNum() {
Version ver = getVersion();
return ECODE_VERSIONNUM( ver.major, ver.minor, ver.patch, ver.commit );
}
std::string Version::getVersionNumString() {
Version ver = getVersion();
if ( ver.commit > 0 && ver.commit < 9999 )
return String::format( "%d.%d.%d-%d", ver.major, ver.minor, ver.patch, ver.commit );
return String::format( "%d.%d.%d", ver.major, ver.minor, ver.patch );
return String::format( "%" PRIu64 ".%" PRIu64 ".%" PRIu64 "-%" PRIu64, ver.major, ver.minor,
ver.patch, ver.commit );
return String::format( "%" PRIu64 ".%" PRIu64 ".%" PRIu64, ver.major, ver.minor, ver.patch );
}
std::string Version::getVersionFullName() {