Browse Source

emscripten related tweaks

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.5.0
falkTX 2 years ago
parent
commit
68af86c5e7
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
3 changed files with 16 additions and 0 deletions
  1. +3
    -0
      .gitignore
  2. +9
    -0
      source/includes/CarlaDefines.h
  3. +4
    -0
      source/modules/ysfx/sources/ysfx_utils_fts.cpp

+ 3
- 0
.gitignore View File

@@ -23,10 +23,13 @@
*.dmg
*.dylib
*.exe
*.html
*.js
*.msi
*.so
*.vst
*.vst3
*.wasm

# Binary dir
/bin/ansi-pedantic-test_*


+ 9
- 0
source/includes/CarlaDefines.h View File

@@ -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"


+ 4
- 0
source/modules/ysfx/sources/ysfx_utils_fts.cpp View File

@@ -23,7 +23,9 @@
#endif

#include "ysfx_utils.hpp"
#ifndef __EMSCRIPTEN__
#include <fts.h>
#endif
#include <string>
#include <cstring>

@@ -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


Loading…
Cancel
Save