Browse Source

Allow to redirect Runner emscript calls, needed for exceptions

Signed-off-by: falkTX <falktx@falktx.com>
pull/321/head
falkTX 3 years ago
parent
commit
02216aba74
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
4 changed files with 14 additions and 6 deletions
  1. +1
    -0
      Makefile.base.mk
  2. +1
    -1
      Makefile.plugins.mk
  3. +1
    -1
      dgl/src/pugl-upstream
  4. +11
    -4
      distrho/extra/Runner.hpp

+ 1
- 0
Makefile.base.mk View File

@@ -269,6 +269,7 @@ endif

ifeq ($(WASM_EXCEPTIONS),true)
BUILD_CXX_FLAGS += -fexceptions
LINK_FLAGS += -fexceptions
endif

ifeq ($(WINDOWS),true)


+ 1
- 1
Makefile.plugins.mk View File

@@ -64,7 +64,7 @@ ifeq ($(WASM),true)

JACK_FLAGS += -sUSE_SDL=2
JACK_LIBS += -sUSE_SDL=2
JACK_LIBS += -sMAIN_MODULE
JACK_LIBS += -sMAIN_MODULE -ldl

ifneq ($(FILE_BROWSER_DISABLED),true)
JACK_LIBS += -sEXPORTED_RUNTIME_METHODS=FS,cwrap


+ 1
- 1
dgl/src/pugl-upstream

@@ -1 +1 @@
Subproject commit c4fd6af2ebd694fcbafeb81619a44ad90639a3b0
Subproject commit 12b10e4bb38da3a88278becdf3c4f31ea1a86f32

+ 11
- 4
distrho/extra/Runner.hpp View File

@@ -28,6 +28,14 @@

START_NAMESPACE_DISTRHO

#ifdef DISTRHO_RUNNER_INDIRECT_WASM_CALLS
long d_emscripten_set_interval(void (*)(void*), double, void*);
void d_emscripten_clear_interval(long);
#else
# define d_emscripten_set_interval emscripten_set_interval
# define d_emscripten_clear_interval emscripten_clear_interval
#endif

// -------------------------------------------------------------------------------------------------------------------
// Runner class

@@ -61,7 +69,6 @@ protected:
{
}


/*
* Destructor.
*/
@@ -117,7 +124,7 @@ public:
return fRunnerThread.startThread();
#else
DISTRHO_SAFE_ASSERT_RETURN(fIntervalId == 0, false);
fIntervalId = emscripten_set_interval(_entryPoint, timeIntervalMilliseconds, this);
fIntervalId = d_emscripten_set_interval(_entryPoint, timeIntervalMilliseconds, this);
return true;
#endif
}
@@ -146,7 +153,7 @@ public:
#else
if (fIntervalId != 0)
{
emscripten_clear_interval(fIntervalId);
d_emscripten_clear_interval(fIntervalId);
fIntervalId = 0;
}
#endif
@@ -223,7 +230,7 @@ private:

if (fIntervalId != 0 && !stillRunning)
{
emscripten_clear_interval(fIntervalId);
d_emscripten_clear_interval(fIntervalId);
fIntervalId = 0;
}
}


Loading…
Cancel
Save