Merge pull request #3293 from eska014/fix-fbsd-pthread
Fix build (pthread renaming) on Open/FreeBSD
This commit is contained in:
commit
662ed9ca8d
@ -30,6 +30,10 @@
|
|||||||
|
|
||||||
#if defined(UNIX_ENABLED) || defined(PTHREAD_ENABLED)
|
#if defined(UNIX_ENABLED) || defined(PTHREAD_ENABLED)
|
||||||
|
|
||||||
|
#ifdef PTHREAD_BSD_SET_NAME
|
||||||
|
#include <pthread_np.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "os/memory.h"
|
#include "os/memory.h"
|
||||||
|
|
||||||
Thread::ID ThreadPosix::get_ID() const {
|
Thread::ID ThreadPosix::get_ID() const {
|
||||||
@ -100,9 +104,14 @@ Error ThreadPosix::set_name(const String& p_name) {
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
#ifdef PTHREAD_BSD_SET_NAME
|
||||||
|
pthread_set_name_np(pthread, p_name.utf8().get_data());
|
||||||
|
int err = 0; // Open/FreeBSD ignore errors in this function
|
||||||
|
#else
|
||||||
int err = pthread_setname_np(pthread, p_name.utf8().get_data());
|
int err = pthread_setname_np(pthread, p_name.utf8().get_data());
|
||||||
|
#endif // PTHREAD_BSD_SET_NAME
|
||||||
|
|
||||||
#endif
|
#endif // PTHREAD_RENAME_SELF
|
||||||
|
|
||||||
return err == 0 ? OK : ERR_INVALID_PARAMETER;
|
return err == 0 ? OK : ERR_INVALID_PARAMETER;
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#if defined(__FreeBSD__) || defined(__OpenBSD__)
|
#if defined(__FreeBSD__) || defined(__OpenBSD__)
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#define PTHREAD_BSD_SET_NAME
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define GLES2_INCLUDE_H "gl_context/glew.h"
|
#define GLES2_INCLUDE_H "gl_context/glew.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user