mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 07:04:36 +00:00
* BugFix: Correct convexDecomp compilation by setting the LINUX flag when necessary.
* BugFix: Update OpenAL to correct a compilation error on Linux.
This commit is contained in:
parent
e071f1d901
commit
7380161054
234 changed files with 30864 additions and 7523 deletions
|
|
@ -90,30 +90,43 @@ bool semaphore::try_wait() noexcept
|
|||
|
||||
#else
|
||||
|
||||
#if defined(HAVE_PTHREAD_SETNAME_NP) || defined(HAVE_PTHREAD_SET_NAME_NP)
|
||||
#include <pthread.h>
|
||||
#ifdef HAVE_PTHREAD_NP_H
|
||||
#include <pthread_np.h>
|
||||
#endif
|
||||
#include <tuple>
|
||||
|
||||
namespace {
|
||||
|
||||
using setname_t1 = int(*)(const char*);
|
||||
using setname_t2 = int(*)(pthread_t, const char*);
|
||||
using setname_t3 = int(*)(pthread_t, const char*, void*);
|
||||
|
||||
void setname_caller(setname_t1 func, const char *name)
|
||||
{ func(name); }
|
||||
|
||||
void setname_caller(setname_t2 func, const char *name)
|
||||
{ func(pthread_self(), name); }
|
||||
|
||||
void setname_caller(setname_t3 func, const char *name)
|
||||
{ func(pthread_self(), "%s", static_cast<void*>(const_cast<char*>(name))); }
|
||||
|
||||
} // namespace
|
||||
|
||||
void althrd_setname(const char *name)
|
||||
{
|
||||
#if defined(HAVE_PTHREAD_SET_NAME_NP)
|
||||
pthread_set_name_np(pthread_self(), name);
|
||||
#elif defined(PTHREAD_SETNAME_NP_ONE_PARAM)
|
||||
pthread_setname_np(name);
|
||||
#elif defined(PTHREAD_SETNAME_NP_THREE_PARAMS)
|
||||
pthread_setname_np(pthread_self(), "%s", (void*)name);
|
||||
#else
|
||||
pthread_setname_np(pthread_self(), name);
|
||||
setname_caller(pthread_set_name_np, name);
|
||||
#elif defined(HAVE_PTHREAD_SETNAME_NP)
|
||||
setname_caller(pthread_setname_np, name);
|
||||
#endif
|
||||
/* Avoid unused function/parameter warnings. */
|
||||
std::ignore = name;
|
||||
std::ignore = static_cast<void(*)(setname_t1,const char*)>(&setname_caller);
|
||||
std::ignore = static_cast<void(*)(setname_t2,const char*)>(&setname_caller);
|
||||
std::ignore = static_cast<void(*)(setname_t3,const char*)>(&setname_caller);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void althrd_setname(const char*) { }
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
|
||||
namespace al {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue