allow pspsdk to be built without pthread-embedded

just like it used to work until 8a0ab6b.

closes #183
This commit is contained in:
rofl0r
2024-03-08 06:51:28 +00:00
parent a411f3c996
commit 5137c71815
4 changed files with 17 additions and 3 deletions

View File

@@ -29,7 +29,7 @@ void __deinit_mutex();
extern int sce_newlib_nocreate_thread_in_start __attribute__((weak));
#ifdef F___libpthreadglue_init
#if defined(F___libpthreadglue_init) && !defined(PSP_WITHOUT_PTHREAD)
/* Note: This function is being called from __libcglue_init.
* It is a weak function because can be override by user program
*/
@@ -38,6 +38,8 @@ void __libpthreadglue_init()
{
pthread_init();
}
#elif defined(PSP_WITHOUT_PTHREAD)
#define __libpthreadglue_init() do{}while(0)
#else
void __libpthreadglue_init();
#endif
@@ -113,4 +115,4 @@ void exit(int retval)
{
_exit(retval);
}
#endif
#endif

View File

@@ -9,6 +9,7 @@
*
*/
#ifndef PSP_WITHOUT_PTHREAD
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
@@ -786,3 +787,5 @@ int pte_osAtomicIncrement(int *pdest)
return val;
}
#endif
#endif /* PSP_WITHOUT_PTHREAD */

View File

@@ -9,6 +9,7 @@
*
*/
#ifndef PSP_WITHOUT_PTHREAD
#include <stdio.h>
#include <stdlib.h>
@@ -251,4 +252,6 @@ pte_osResult pte_osTlsFree(unsigned int index)
{
return pteTlsFree(index);
}
#endif
#endif
#endif /* PSP_WITHOUT_PTHREAD */