Bug 1320179 - Part 4: MOZ_OBJDIR->MOZ_TOPOBJDIR and update m-c-changes.patch for protobuf changes, r=fitzgen
authorMichael Layzell <michael@thelayzells.com>
Thu, 06 Apr 2017 17:32:58 -0400
changeset 351774 04c98671aaf85e8a60ac8d89dacb96417d019715
parent 351773 e1bcf8686408e81c7b14bd2014b9b9653290e8e4
child 351775 5880d471d75caf7ca6ce8d0848737a78131151da
push id31621
push userarchaeopteryx@coole-files.de
push dateFri, 07 Apr 2017 20:14:04 +0000
treeherdermozilla-central@35c7be9c2db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfitzgen
bugs1320179
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1320179 - Part 4: MOZ_OBJDIR->MOZ_TOPOBJDIR and update m-c-changes.patch for protobuf changes, r=fitzgen MozReview-Commit-ID: EPhkF350sGY
config/rules.mk
toolkit/components/protobuf/m-c-changes.patch
xpcom/rust/nserror/src/lib.rs
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -924,17 +924,17 @@ endif
 CARGO_BUILD = env $(rustflags_override) \
 	CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) \
 	RUSTC=$(RUSTC) \
 	MOZ_DIST=$(ABS_DIST) \
 	LIBCLANG_PATH=$(MOZ_LIBCLANG_PATH) \
 	CLANG_PATH=$(MOZ_CLANG_PATH) \
 	PKG_CONFIG_ALLOW_CROSS=1 \
 	RUST_BACKTRACE=1 \
-	MOZ_OBJDIR=$(topobjdir) \
+	MOZ_TOPOBJDIR=$(topobjdir) \
 	$(CARGO) build $(cargo_build_flags)
 
 ifdef RUST_LIBRARY_FILE
 
 ifdef RUST_LIBRARY_FEATURES
 rust_features_flag := --features "$(RUST_LIBRARY_FEATURES)"
 endif
 
--- a/toolkit/components/protobuf/m-c-changes.patch
+++ b/toolkit/components/protobuf/m-c-changes.patch
@@ -195,24 +195,28 @@
                       // compiled in debug mode.
  
  #ifdef NDEBUG
    LOGLEVEL_DFATAL = LOGLEVEL_ERROR
  #else
    LOGLEVEL_DFATAL = LOGLEVEL_FATAL
  #endif
 +
-+#ifdef ERROR
++#ifdef _WIN32
 +  // ERROR is defined as 0 on some windows builds, so `GOOGLE_LOG(ERROR, ...)`
 +  // expands into `GOOGLE_LOG(0, ...)` which then expands into
 +  // `someGoogleLogging(LOGLEVEL_0, ...)`. This is not ideal, because the
 +  // GOOGLE_LOG macro expects to expand itself into
 +  // `someGoogleLogging(LOGLEVEL_ERROR, ...)` instead. The workaround to get
 +  // everything building is to simply define LOGLEVEL_0 as LOGLEVEL_ERROR and
 +  // move on with our lives.
++  //
++  // We also define ERROR the same way that the Windows SDK does for
++  // consistency.
++#define ERROR 0
 +  , LOGLEVEL_0 = LOGLEVEL_ERROR
 +#endif
  };
  
  namespace internal {
  
  class LogFinisher;
  
--- a/xpcom/rust/nserror/src/lib.rs
+++ b/xpcom/rust/nserror/src/lib.rs
@@ -51,12 +51,12 @@ impl NsresultExt for nsresult {
     }
 }
 
 extern "C" {
     fn Gecko_GetErrorName(rv: nsresult, cstr: *mut nsACString);
 }
 
 mod error_list {
-    include!(concat!(env!("MOZ_OBJDIR"), "/xpcom/base/error_list.rs"));
+    include!(concat!(env!("MOZ_TOPOBJDIR"), "/xpcom/base/error_list.rs"));
 }
 
 pub use error_list::*;