macOS/glog: Silence syscall deprecation warning
Upstream will release the fix in 0.6 which will take time. Silence two warnings. Differential Revision: https://developer.blender.org/D11246
This commit is contained in:
parent
c614eadb47
commit
49b798ca7e
|
@ -7,3 +7,4 @@ Local modifications:
|
|||
checks for functions and so are needed.
|
||||
* Added special definitions of HAVE_SNPRINTF and HAVE_LIB_GFLAGS
|
||||
in Windows' specific config.h.
|
||||
* Silenced syscall deprecation warnings on macOS >= 10.12.
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_SYSCALL_H) || defined(HAVE_SYS_SYSCALL_H)
|
||||
#if (defined(HAVE_SYSCALL_H) || defined(HAVE_SYS_SYSCALL_H)) && (!(defined OS_MACOSX))
|
||||
# define safe_write(fd, s, len) syscall(SYS_write, fd, s, len)
|
||||
#else
|
||||
// Not so safe, but what can you do?
|
||||
|
|
|
@ -259,7 +259,13 @@ pid_t GetTID() {
|
|||
#endif
|
||||
static bool lacks_gettid = false;
|
||||
if (!lacks_gettid) {
|
||||
#ifdef OS_MACOSX
|
||||
uint64_t tid64;
|
||||
const int error = pthread_threadid_np(NULL, &tid64);
|
||||
pid_t tid = error ? -1 : (pid_t)tid64;
|
||||
#else
|
||||
pid_t tid = syscall(__NR_gettid);
|
||||
#endif
|
||||
if (tid != -1) {
|
||||
return tid;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue