I am working on porting a game which compiles fine when using the SDL threads, but as soon as it tries to start I get a crash on threads, like below:
Stack trace:
native kernel module kernel+0x00036784
native kernel module kernel+0x0005c62c
[autodownload.cpp:80] client:_Z13pingpckserverPv()+0x180 (section 1 @ 0x1F72C)
ac_client:SDL_RunThread()+0x48 (section 1 @ 0x2E94E8)
ac_client:OS4_RunThread()+0xa0 (section 1 @ 0x2EA3D4)
native kernel module dos.library.kmod+0x00029e18
native kernel module kernel+0x0005f21c
native kernel module kernel+0x0005f294
In code I see something like below:
#ifdef USE_SDL_THREADS
#include "SDL_timer.h"
#include "SDL_thread.h" // also fetches SDL_mutex.h
#else
#include <pthread.h>
#include <semaphore.h>
#include <sys/shm.h>
#endif
I thought to try to compile without SDL threads, but because I am using newlib there is no semaphore.h there.
What I would like to ask, is SDL threads used or you always try to use something else?
Does anyone have any workaround for semaphore to be used with newlib?
Thank you for your help.