Skip to content

Commit

Permalink
Fix emscripten compilation errors and warnings (google#6688)
Browse files Browse the repository at this point in the history
These errors and warnings only appear with more recent versions of
the emscripten SDK.
  • Loading branch information
romainguy authored Mar 28, 2023
1 parent af35b87 commit 53aac25
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion third_party/basisu/encoder/basisu_enc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ namespace basisu
{
QueryPerformanceFrequency(reinterpret_cast<LARGE_INTEGER*>(pTicks));
}
#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__wasm__)
#include <sys/time.h>
inline void query_counter(timer_ticks* pTicks)
{
Expand Down
17 changes: 17 additions & 0 deletions third_party/basisu/tnt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,23 @@ This folder was last updated as follows:
rm -rf ${ver}.zip basis_new
git add basisu ; git status

!!! IMPORTANT:
If using a version of basisu <= 1.16.3, the following patch is required:
https://github.com/BinomialLLC/basis_universal/commit/53372fc512e6b91c06b28fd47248f269b9b5b010

!!! IMPORTANT:
If basisu doesn't have that change, in basisu_containers.h, update the following macro:

#if defined(__GNUC__) && __GNUC__<5
#define BASISU_IS_TRIVIALLY_COPYABLE(...) __has_trivial_copy(__VA_ARGS__)

to:

#if defined(__GNUC__) && __GNUC__<5
#define BASISU_IS_TRIVIALLY_COPYABLE(...) __is_trivially_copyable(__VA_ARGS__)



Our CMakeLists differs from the one in basisu as follows.

(1)
Expand Down
2 changes: 1 addition & 1 deletion third_party/basisu/transcoder/basisu_containers.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ namespace basisu
#define BASISU_IS_SCALAR_TYPE(T) (scalar_type<T>::cFlag)

#if defined(__GNUC__) && __GNUC__<5
#define BASISU_IS_TRIVIALLY_COPYABLE(...) __has_trivial_copy(__VA_ARGS__)
#define BASISU_IS_TRIVIALLY_COPYABLE(...) __is_trivially_copyable(__VA_ARGS__)
#else
#define BASISU_IS_TRIVIALLY_COPYABLE(...) std::is_trivially_copyable<__VA_ARGS__>::value
#endif
Expand Down

0 comments on commit 53aac25

Please sign in to comment.