Skip to content

Commit 2aa120f

Browse files
committed
Should fix WASM build
1 parent e7bfb29 commit 2aa120f

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src_c/base.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
PG_PixelFormatEnum pg_default_convert_format = 0;
2929

3030
/* Custom exceptions */
31-
static PyObject *pgExc_BufferError = NULL;
31+
PyObject *pgExc_BufferError = NULL;
3232

3333
/* Only one instance of the state per process. */
3434
static PyObject *pg_quit_functions = NULL;
@@ -2081,13 +2081,6 @@ static PyMethodDef _base_methods[] = {
20812081
"return an array struct interface as an interface dictionary"},
20822082
{NULL, NULL, 0, NULL}};
20832083

2084-
#if defined(BUILD_STATIC) && defined(NO_PYGAME_C_API)
2085-
// in case of wasm+dynamic loading it could be a trampoline in the globals
2086-
// generated at runtime.
2087-
// when building static make global accessible symbol directly.
2088-
static PyObject *pgExc_SDLError;
2089-
#endif
2090-
20912084
MODINIT_DEFINE(base)
20922085
{
20932086
PyObject *module, *apiobj, *atexit;

src_c/base.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ typedef struct pg_view_internals_s {
5555
} pgViewInternals;
5656

5757
extern PG_PixelFormatEnum pg_default_convert_format;
58+
extern PyObject *pgExc_BufferError;
5859
extern SDL_Window *pg_default_window;
5960
extern pgSurfaceObject *pg_default_screen;
6061

@@ -217,6 +218,13 @@ pg_SetDefaultConvertFormat(PG_PixelFormatEnum format);
217218
PG_PixelFormatEnum
218219
pg_GetDefaultConvertFormat(void);
219220

221+
#if defined(BUILD_STATIC) && defined(NO_PYGAME_C_API)
222+
// in case of wasm+dynamic loading it could be a trampoline in the globals
223+
// generated at runtime.
224+
// when building static make global accessible symbol directly.
225+
extern PyObject *pgExc_SDLError;
226+
#endif
227+
220228
MODINIT_DEFINE(base);
221229

222230
/*=======static inline function definitions=======*/

0 commit comments

Comments
 (0)