Skip to content

Commit

Permalink
Merge pull request #456 from iboB/pthread_linker_error
Browse files Browse the repository at this point in the history
sokol_app.h: trigger a linker error if users forget -pthread
  • Loading branch information
floooh committed Jan 13, 2021
2 parents 924f13b + a75e2ab commit 0649a40
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sokol_app.h
Expand Up @@ -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;

Expand Down

0 comments on commit 0649a40

Please sign in to comment.