diff options
| author | Andre Weissflog <floooh@gmail.com> | 2021-01-13 13:47:03 +0100 |
|---|---|---|
| committer | Andre Weissflog <floooh@gmail.com> | 2021-01-13 13:47:03 +0100 |
| commit | 5fbb6a25501e5478674ca0600a7539033592d749 (patch) | |
| tree | 6afe66ce7d9d97c801a5954cc92b08f1b9ee57de | |
| parent | 0649a40f9cb37a16f16664e8b2d3e11b8142f55e (diff) | |
sokol_app.h linux: fix -pthread guard code (use pthread_attr_init/destroy)
| -rw-r--r-- | sokol_app.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sokol_app.h b/sokol_app.h index ec072a32..58cfa7c7 100644 --- a/sokol_app.h +++ b/sokol_app.h @@ -1539,6 +1539,7 @@ inline void sapp_run(const sapp_desc& desc) { return sapp_run(&desc); } #include <GL/gl.h> #include <dlfcn.h> /* dlopen, dlsym, dlclose */ #include <limits.h> /* LONG_MAX */ + #include <pthread.h> /* only used a linker-guard, search for _sapp_linux_run() and see first comment */ #endif /*== MACOS DECLARATIONS ======================================================*/ @@ -10030,12 +10031,14 @@ _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(); + /* The following lines are 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. They have no other purpose. + */ + pthread_attr_t pthread_attr; + pthread_attr_init(&pthread_attr); + pthread_attr_destroy(&pthread_attr); _sapp_init_state(desc); _sapp.x11.window_state = NormalState; |