From a75e2ab8f41b630dae0121a490f2e5d6596ce6e3 Mon Sep 17 00:00:00 2001 From: Borislav Stanimirov Date: Sat, 9 Jan 2021 21:33:09 +0200 Subject: [PATCH] sokol_app.h: trigger a linker error if users forget -pthread. Closes #455 --- sokol_app.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sokol_app.h b/sokol_app.h index 9a441719d..ec072a326 100644 --- a/sokol_app.h +++ b/sokol_app.h @@ -10030,7 +10030,13 @@ _SOKOL_PRIVATE void _sapp_x11_process_event(XEvent* event) { } } +extern int pthread_yield(void); // see below _SOKOL_PRIVATE void _sapp_linux_run(const sapp_desc* desc) { + // The following line is here to trigger a linker error instead of an + // obscure runtime error if the user has forgotten to add -pthread to + // the compiler or linker options. It has no other purpose. + pthread_yield(); + _sapp_init_state(desc); _sapp.x11.window_state = NormalState;