Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-03-11 23:52:25 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-03-11 23:52:25 +0400
commit42b3463030b07ba3a87574c173e759e3bb15353b (patch)
tree1f7c20c45c294d9137bd75efabc414b02e6d7f60 /extern/libmv/third_party/glog/src/utilities.cc
parentc21c58f44c16b3d503d81577c1943f1f4b47b675 (diff)
Bundle new upstream version of libmv from own branch
This version of libmv includes new gflags and glog libraries which makes it possible to compile libmv with clang compiler. Also remove code from CMakeLists which was disabling libmv if using clang. Tested on linux with gcc-4.6 and clang-3.0, windows cmake+msvc and scons+mingw. Could be some issues with other platforms/build system which shall be simple to resolve.
Diffstat (limited to 'extern/libmv/third_party/glog/src/utilities.cc')
-rw-r--r--extern/libmv/third_party/glog/src/utilities.cc27
1 files changed, 19 insertions, 8 deletions
diff --git a/extern/libmv/third_party/glog/src/utilities.cc b/extern/libmv/third_party/glog/src/utilities.cc
index 6d64b923703..27b2a905055 100644
--- a/extern/libmv/third_party/glog/src/utilities.cc
+++ b/extern/libmv/third_party/glog/src/utilities.cc
@@ -77,9 +77,11 @@ typedef void DebugWriter(const char*, void*);
// For some environments, add two extra bytes for the leading "0x".
static const int kPrintfPointerFieldWidth = 2 + 2 * sizeof(void*);
-static void DebugWriteToStderr(const char* data, void *unused) {
+static void DebugWriteToStderr(const char* data, void *) {
// This one is signal-safe.
- write(STDERR_FILENO, data, strlen(data));
+ if (write(STDERR_FILENO, data, strlen(data)) < 0) {
+ // Ignore errors.
+ }
}
void DebugWriteToString(const char* data, void *arg) {
@@ -221,9 +223,18 @@ int32 GetMainThreadPid() {
return g_main_thread_pid;
}
+bool PidHasChanged() {
+ int32 pid = getpid();
+ if (g_main_thread_pid == pid) {
+ return false;
+ }
+ g_main_thread_pid = pid;
+ return true;
+}
+
pid_t GetTID() {
// On Linux and FreeBSD, we try to use gettid().
-#if defined OS_LINUX || defined OS_MACOSX
+#if defined OS_LINUX || defined OS_FREEBSD || defined OS_MACOSX
#ifndef __NR_gettid
#ifdef OS_MACOSX
#define __NR_gettid SYS_gettid
@@ -302,9 +313,7 @@ void SetCrashReason(const CrashReason* r) {
r);
}
-} // namespace glog_internal_namespace_
-
-void InitGoogleLogging(const char* argv0) {
+void InitGoogleLoggingUtilities(const char* argv0) {
CHECK(!IsGoogleLoggingInitialized())
<< "You called InitGoogleLogging() twice!";
const char* slash = strrchr(argv0, '/');
@@ -319,14 +328,16 @@ void InitGoogleLogging(const char* argv0) {
#endif
}
-void ShutdownGoogleLogging() {
+void ShutdownGoogleLoggingUtilities() {
CHECK(IsGoogleLoggingInitialized())
- << "You called ShutdownGoogleLogging() without InitGoogleLogging() first!";
+ << "You called ShutdownGoogleLogging() without calling InitGoogleLogging() first!";
#ifdef HAVE_SYSLOG_H
closelog();
#endif
}
+} // namespace glog_internal_namespace_
+
_END_GOOGLE_NAMESPACE_
// Make an implementation of stacktrace compiled.