Bug 1059038 - Move mozilla::unused from xpcom/glue to mfbt. r=Waldo
authorJed Davis <jld@mozilla.com>
Fri, 29 Aug 2014 10:11:00 +0200
changeset 227464 dc971e50ebf08dcf64a23a5841b04f9f383d8579
parent 227463 3f9b3f11c39d95547d385f4a7c7dcaaa5bb5237d
child 227465 b074336ad3f16d0eeb20f1e995f478d563c1f89a
push id1
push usersledru@mozilla.com
push dateThu, 04 Dec 2014 17:57:20 +0000
reviewersWaldo
bugs1059038
milestone35.0a1
Bug 1059038 - Move mozilla::unused from xpcom/glue to mfbt. r=Waldo
mfbt/moz.build
mfbt/unused.cpp
mfbt/unused.h
security/sandbox/linux/moz.build
xpcom/glue/moz.build
xpcom/glue/objs.mozbuild
xpcom/glue/unused.cpp
xpcom/glue/unused.h
--- a/mfbt/moz.build
+++ b/mfbt/moz.build
@@ -67,16 +67,17 @@ EXPORTS.mozilla = [
     'TypedEnum.h',
     'TypedEnumBits.h',
     'TypedEnumInternal.h',
     'Types.h',
     'TypeTraits.h',
     'UniquePtr.h',
     'Vector.h',
     'WeakPtr.h',
+    'unused.h',
 ]
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     EXPORTS.mozilla += [
         'WindowsVersion.h',
     ]
 elif CONFIG['OS_ARCH'] == 'Linux':
     EXPORTS.mozilla += [
@@ -92,16 +93,17 @@ UNIFIED_SOURCES = [
     'double-conversion/fast-dtoa.cc',
     'double-conversion/fixed-dtoa.cc',
     'double-conversion/strtod.cc',
     'FloatingPoint.cpp',
     'HashFunctions.cpp',
     'Poison.cpp',
     'SHA1.cpp',
     'TaggedAnonymousMemory.cpp',
+    'unused.cpp',
 ]
 
 DEFINES['IMPL_MFBT'] = True
 
 # Compression.cpp cannot be built in unified mode because it pulls in Windows system headers.
 # Decimal.cpp doesn't build in unified mode with gcc.
 SOURCES += [
     'Compression.cpp',
rename from xpcom/glue/unused.cpp
rename to mfbt/unused.cpp
rename from xpcom/glue/unused.h
rename to mfbt/unused.h
--- a/xpcom/glue/unused.h
+++ b/mfbt/unused.h
@@ -2,29 +2,29 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_unused_h
 #define mozilla_unused_h
 
-#include "nscore.h"
+#include "mozilla/Types.h"
 
 namespace mozilla {
 
 //
 // Suppress GCC warnings about unused return values with
 //   unused << SomeFuncDeclaredWarnUnusedReturnValue();
 //
 struct unused_t
 {
 };
 
-extern const unused_t unused;
+extern MFBT_DATA const unused_t unused;
 
 template<typename T>
 inline void
 operator<<(const unused_t& /*unused*/, const T& /*unused*/)
 {
 }
 
 }
--- a/security/sandbox/linux/moz.build
+++ b/security/sandbox/linux/moz.build
@@ -8,18 +8,16 @@ FAIL_ON_WARNINGS = True
 
 SharedLibrary('mozsandbox')
 
 EXPORTS.mozilla += [
     'Sandbox.h',
 ]
 
 SOURCES += [
-    # Bug 1059038 workaround:
-    '../../../xpcom/glue/unused.cpp',
     '../chromium/base/shim/base/logging.cpp',
     '../chromium/sandbox/linux/seccomp-bpf/basicblock.cc',
     '../chromium/sandbox/linux/seccomp-bpf/codegen.cc',
     '../chromium/sandbox/linux/seccomp-bpf/die.cc',
     '../chromium/sandbox/linux/seccomp-bpf/syscall.cc',
     'Sandbox.cpp',
     'SandboxAssembler.cpp',
     'SandboxFilter.cpp',
--- a/xpcom/glue/moz.build
+++ b/xpcom/glue/moz.build
@@ -73,17 +73,16 @@ EXPORTS.mozilla += [
     'FileUtils.h',
     'GenericFactory.h',
     'HoldDropJSObjects.h',
     'IntentionalCrash.h',
     'Monitor.h',
     'Mutex.h',
     'Observer.h',
     'ReentrantMonitor.h',
-    'unused.h',
 ]
 
 EXPORTS.mozilla.threads += [
     'nsThreadIDs.h',
 ]
 
 include('objs.mozbuild')
 
--- a/xpcom/glue/objs.mozbuild
+++ b/xpcom/glue/objs.mozbuild
@@ -38,14 +38,13 @@ xpcom_glue_src_cppsrcs = [
     '%s/xpcom/glue/%s' % (TOPSRCDIR, s) for s in xpcom_glue_src_lcppsrcs
 ]
 
 xpcom_gluens_src_lcppsrcs = [
     'BlockingResourceBase.cpp',
     'GenericFactory.cpp',
     'nsProxyRelease.cpp',
     'nsTextFormatter.cpp',
-    'unused.cpp',
 ]
 
 xpcom_gluens_src_cppsrcs = [
     '%s/xpcom/glue/%s' % (TOPSRCDIR, s) for s in xpcom_gluens_src_lcppsrcs
 ]