patch [#30331] Support clang-3.0
authorCampbell Barton <ideasman42@gmail.com>
Tue, 28 Feb 2012 05:26:15 +0000 (05:26 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 28 Feb 2012 05:26:15 +0000 (05:26 +0000)
from Yasuhiro Fujii (y-fujii)

 added the diff to libmv/patches so it can be applied upstream.

extern/libmv/patches/clang-3.diff [new file with mode: 0644]
extern/libmv/patches/series
extern/libmv/third_party/glog/src/logging.cc
extern/libmv/third_party/glog/src/utilities.h

diff --git a/extern/libmv/patches/clang-3.diff b/extern/libmv/patches/clang-3.diff
new file mode 100644 (file)
index 0000000..9e73490
--- /dev/null
@@ -0,0 +1,49 @@
+Index: third_party/glog/src/utilities.h
+===================================================================
+--- third_party/glog/src/utilities.h   (revision 44501)
++++ third_party/glog/src/utilities.h   (working copy)
+@@ -105,7 +105,7 @@
+ # undef STACKTRACE_H
+ #elif defined(HAVE_LIB_UNWIND)
+ # define STACKTRACE_H "stacktrace_libunwind-inl.h"
+-#elif !defined(NO_FRAME_POINTER)
++#elif !defined(NO_FRAME_POINTER) && !defined(__clang__)
+ # if defined(__i386__) && __GNUC__ >= 2
+ #  define STACKTRACE_H "stacktrace_x86-inl.h"
+ # elif defined(__x86_64__) && __GNUC__ >= 2
+Index: third_party/glog/src/logging.cc
+===================================================================
+--- third_party/glog/src/logging.cc    (revision 44501)
++++ third_party/glog/src/logging.cc    (working copy)
+@@ -1231,6 +1231,14 @@
+ #endif
+ }
++#if defined(HAVE___ATTRIBUTE__)
++typedef void (*fail_func_t)() __attribute__((noreturn));
++static void logging_fail() __attribute__((noreturn));
++#else
++typedef void (*fail_func_t)();
++static void logging_fail();
++#endif
++
+ static void logging_fail() {
+ // #if defined(_DEBUG) && defined(_MSC_VER)
+ // doesn't work for my laptop (sergey)
+@@ -1243,14 +1251,9 @@
+ #endif
+ }
+-#ifdef HAVE___ATTRIBUTE__
+-GOOGLE_GLOG_DLL_DECL
+-void (*g_logging_fail_func)() __attribute__((noreturn)) = &logging_fail;
+-#else
+-GOOGLE_GLOG_DLL_DECL void (*g_logging_fail_func)() = &logging_fail;
+-#endif
++GOOGLE_GLOG_DLL_DECL fail_func_t g_logging_fail_func = &logging_fail;
+-void InstallFailureFunction(void (*fail_func)()) {
++void InstallFailureFunction(fail_func_t fail_func) {
+   g_logging_fail_func = fail_func;
+ }
index ca671122a618048fcc12014a52bf2c149a690441..2b2e69bd8494bb4621c4703a87da46a0f8708057 100644 (file)
@@ -1,2 +1,3 @@
 v3d_verbosity.patch
 bundle_tweaks.patch
+clang-3.diff
index 1bb3867aa1073644377713d8ecf5762006fb23a6..f7488b3e04cb34bba7a213338b391f05129aae79 100644 (file)
@@ -1231,6 +1231,14 @@ void LogMessage::RecordCrashReason(
 #endif
 }
 
+#if defined(HAVE___ATTRIBUTE__)
+typedef void (*fail_func_t)() __attribute__((noreturn));
+static void logging_fail() __attribute__((noreturn));
+#else
+typedef void (*fail_func_t)();
+static void logging_fail();
+#endif
+
 static void logging_fail() {
 // #if defined(_DEBUG) && defined(_MSC_VER)
 // doesn't work for my laptop (sergey)
@@ -1243,14 +1251,9 @@ static void logging_fail() {
 #endif
 }
 
-#ifdef HAVE___ATTRIBUTE__
-GOOGLE_GLOG_DLL_DECL
-void (*g_logging_fail_func)() __attribute__((noreturn)) = &logging_fail;
-#else
-GOOGLE_GLOG_DLL_DECL void (*g_logging_fail_func)() = &logging_fail;
-#endif
+GOOGLE_GLOG_DLL_DECL fail_func_t g_logging_fail_func = &logging_fail;
 
-void InstallFailureFunction(void (*fail_func)()) {
+void InstallFailureFunction(fail_func_t fail_func) {
   g_logging_fail_func = fail_func;
 }
 
index bbb0eb0746cd032f6a9a120816c29b24be76dec4..6d7262e84ae17da685c43ae2966f956094b67fcc 100644 (file)
 # undef STACKTRACE_H
 #elif defined(HAVE_LIB_UNWIND)
 # define STACKTRACE_H "stacktrace_libunwind-inl.h"
-#elif !defined(NO_FRAME_POINTER)
+#elif !defined(NO_FRAME_POINTER) && !defined(__clang__)
 # if defined(__i386__) && __GNUC__ >= 2
 #  define STACKTRACE_H "stacktrace_x86-inl.h"
 # elif defined(__x86_64__) && __GNUC__ >= 2