From 68af86c5e7387fcd99becd3b95322b0fe7c8652e Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 2 Jul 2022 21:44:30 +0100 Subject: [PATCH] emscripten related tweaks Signed-off-by: falkTX --- .gitignore | 3 +++ source/includes/CarlaDefines.h | 9 +++++++++ source/modules/ysfx/sources/ysfx_utils_fts.cpp | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/.gitignore b/.gitignore index 94384e61c..ad1ae4971 100644 --- a/.gitignore +++ b/.gitignore @@ -23,10 +23,13 @@ *.dmg *.dylib *.exe +*.html +*.js *.msi *.so *.vst *.vst3 +*.wasm # Binary dir /bin/ansi-pedantic-test_* diff --git a/source/includes/CarlaDefines.h b/source/includes/CarlaDefines.h index 2846e78b3..a176b8e8b 100644 --- a/source/includes/CarlaDefines.h +++ b/source/includes/CarlaDefines.h @@ -51,6 +51,8 @@ # define CARLA_OS_BSD #elif defined(__GNU__) # define CARLA_OS_GNU_HURD +#elif defined(__EMSCRIPTEN__) +# define CARLA_OS_WASM #else # warning Unsupported platform! #endif @@ -110,6 +112,13 @@ # define P_UINTPTR "%x" # define P_SIZE "%u" # define P_SSIZE "%i" +#elif defined(CARLA_OS_WASM) +# define P_INT64 "%lli" +# define P_UINT64 "%llu" +# define P_INTPTR "%li" +# define P_UINTPTR "%lx" +# define P_SIZE "%lu" +# define P_SSIZE "%li" #elif defined(CARLA_OS_MAC) # define P_INT64 "%lli" # define P_UINT64 "%llu" diff --git a/source/modules/ysfx/sources/ysfx_utils_fts.cpp b/source/modules/ysfx/sources/ysfx_utils_fts.cpp index c607866ce..a836b50c1 100644 --- a/source/modules/ysfx/sources/ysfx_utils_fts.cpp +++ b/source/modules/ysfx/sources/ysfx_utils_fts.cpp @@ -23,7 +23,9 @@ #endif #include "ysfx_utils.hpp" +#ifndef __EMSCRIPTEN__ #include +#endif #include #include @@ -31,6 +33,7 @@ namespace ysfx { void visit_directories(const char *rootpath, bool (*visit)(const std::string &, void *), void *data) { +#ifndef __EMSCRIPTEN__ char *argv[] = {(char *)rootpath, nullptr}; auto compar = [](const FTSENT **a, const FTSENT **b) -> int { @@ -53,6 +56,7 @@ void visit_directories(const char *rootpath, bool (*visit)(const std::string &, return; } } +#endif } } // namespace ysfx