diff options
author | Ankit Meel <ankitjmeel@gmail.com> | 2021-07-15 12:53:06 +0300 |
---|---|---|
committer | Ankit Meel <ankitjmeel@gmail.com> | 2021-07-15 12:53:06 +0300 |
commit | 49b798ca7e1d1499f855166e904f8885181cadcf (patch) | |
tree | 1f8e45a8eafebeafc210aca0711a6cdad6d625a8 /extern | |
parent | c614eadb479e43258586af16deef6bd7d873ac59 (diff) |
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
Diffstat (limited to 'extern')
-rw-r--r-- | extern/glog/README.blender | 1 | ||||
-rw-r--r-- | extern/glog/src/raw_logging.cc | 2 | ||||
-rw-r--r-- | extern/glog/src/utilities.cc | 6 |
3 files changed, 8 insertions, 1 deletions
diff --git a/extern/glog/README.blender b/extern/glog/README.blender index 5b4dab199bf..bc2ca9f958e 100644 --- a/extern/glog/README.blender +++ b/extern/glog/README.blender @@ -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. diff --git a/extern/glog/src/raw_logging.cc b/extern/glog/src/raw_logging.cc index 3bbfda31868..15d14f6e4f5 100644 --- a/extern/glog/src/raw_logging.cc +++ b/extern/glog/src/raw_logging.cc @@ -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? diff --git a/extern/glog/src/utilities.cc b/extern/glog/src/utilities.cc index 25c4b760f1c..6387e14e123 100644 --- a/extern/glog/src/utilities.cc +++ b/extern/glog/src/utilities.cc @@ -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; } |