Skip to content

Commit d6284bb

Browse files
authored
Fix SDL1 deps (#19610)
FS is only used in one specific method, so put the dep there. That avoids a WasmFS closure error on including FS without enough WasmFS code (which should not happen in practice, as that method loads data from a file - so WasmFS would be present to support those file operatoins). Also intArrayFromString is used and was not declared.
1 parent 53a4096 commit d6284bb

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/library_sdl.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@ var LibrarySDL = {
2626
$SDL_audio: function() { return SDL.audio; },
2727

2828
$SDL__deps: [
29-
#if FILESYSTEM
30-
'$FS',
31-
#endif
3229
'$PATH', '$Browser', 'SDL_GetTicks', 'SDL_LockSurface',
33-
'$SDL_unicode', '$SDL_ttfContext', '$SDL_audio'
30+
'$SDL_unicode', '$SDL_ttfContext', '$SDL_audio',
31+
// For makeCEvent().
32+
'$intArrayFromString',
3433
],
3534
$SDL: {
3635
defaults: {
@@ -2687,7 +2686,11 @@ var LibrarySDL = {
26872686
return 1;
26882687
},
26892688

2690-
Mix_LoadWAV_RW__deps: ['$PATH_FS', 'fileno'],
2689+
Mix_LoadWAV_RW__deps: [
2690+
'$FS',
2691+
'$PATH_FS',
2692+
'fileno',
2693+
],
26912694
Mix_LoadWAV_RW__proxy: 'sync',
26922695
Mix_LoadWAV_RW__docs: '/** @param {number} freesrc */',
26932696
Mix_LoadWAV_RW: function(rwopsID, freesrc) {

test/test_browser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2119,6 +2119,7 @@ def test_cubegeom_proc(self, opts):
21192119
''')
21202120
self.btest('third_party/cubegeom/cubegeom_proc.c', reference='third_party/cubegeom/cubegeom.png', args=opts + ['side.c', '-sLEGACY_GL_EMULATION', '-lGL', '-lSDL'])
21212121

2122+
@also_with_wasmfs
21222123
@requires_graphics_hardware
21232124
def test_cubegeom_glew(self):
21242125
self.btest('third_party/cubegeom/cubegeom_glew.c', reference='third_party/cubegeom/cubegeom.png', args=['-O2', '--closure=1', '-sLEGACY_GL_EMULATION', '-lGL', '-lGLEW', '-lSDL'])

0 commit comments

Comments
 (0)