Bug 1020661: Ignore GCC warning Wunused-local-typedefs inside of webrtc's scoped_ptr.h header. r=jesup
authorDaniel Holbert <dholbert@cs.stanford.edu>
Wed, 20 Aug 2014 14:56:12 -0700
changeset 200708 177b9f5de1b6e948a745a53e0cb039ed7486186b
parent 200707 b8234b53f28dd018c6d64b86714d6edb063b3f0d
child 200709 3d8dd1441e53ac2fa34d01c393d1e387508f93a5
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersjesup
bugs1020661
milestone34.0a1
Bug 1020661: Ignore GCC warning Wunused-local-typedefs inside of webrtc's scoped_ptr.h header. r=jesup
dom/media/moz.build
media/webrtc/trunk/webrtc/system_wrappers/interface/scoped_ptr.h
--- a/dom/media/moz.build
+++ b/dom/media/moz.build
@@ -8,21 +8,16 @@ DIRS += ['gmp-plugin']
 if CONFIG['MOZ_WEBRTC']:
     DIRS += ['bridge']
 
     LOCAL_INCLUDES += [
         '/media/webrtc/signaling/src/common',
         '/media/webrtc/trunk',
     ]
 
-    if CONFIG['GNU_CXX']:
-        CXXFLAGS += [
-            '-Wno-unused-local-typedefs', # Workaround until we fix bug 1020661
-        ]
-
     MOCHITEST_MANIFESTS += ['tests/mochitest/mochitest.ini']
     WEBRTC_SIGNALLING_TEST_MANIFESTS += ['tests/mochitest/steeplechase.ini']
 
 XPIDL_SOURCES += [
     'nsIDOMMediaStream.idl',
     'nsIDOMNavigatorUserMedia.idl',
     'nsIMediaManager.idl',
 ]
--- a/media/webrtc/trunk/webrtc/system_wrappers/interface/scoped_ptr.h
+++ b/media/webrtc/trunk/webrtc/system_wrappers/interface/scoped_ptr.h
@@ -105,16 +105,26 @@
 #include <algorithm>  // For std::swap().
 
 #include "webrtc/system_wrappers/interface/compile_assert.h"
 #include "webrtc/system_wrappers/interface/constructor_magic.h"
 #include "webrtc/system_wrappers/interface/template_util.h"
 #include "webrtc/system_wrappers/source/move.h"
 #include "webrtc/typedefs.h"
 
+// XXX This file creates unused typedefs as a way of doing static assertions,
+// both via COMPILE_ASSERT and via direct typedefs like
+// 'type_must_be_complete'. These trigger a GCC warning, which we disable here.
+// This can be removed if & when this file (and COMPILE_ASSERT) stops using
+// these typedefs.
+#if defined(__GNUC__) && !defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
+#endif // defined(__GNUC__) && !defined(__clang__)
+
 namespace webrtc {
 
 // Function object which deletes its parameter, which must be a pointer.
 // If C is an array type, invokes 'delete[]' on the parameter; otherwise,
 // invokes 'delete'. The default deleter for scoped_ptr<T>.
 template <class T>
 struct DefaultDeleter {
   DefaultDeleter() {}
@@ -707,9 +717,14 @@ template<typename T, void (*FF)(void*) =
 
 template<typename T, void (*FF)(void*)> inline
 void swap(scoped_ptr_malloc<T,FF>& a, scoped_ptr_malloc<T,FF>& b) {
   a.swap(b);
 }
 
 }  // namespace webrtc
 
+// Pop off 'ignored "-Wunused-local-typedefs"':
+#if defined(__GNUC__) && !defined(__clang__)
+#pragma GCC diagnostic pop
+#endif // defined(__GNUC__) && !defined(__clang__)
+
 #endif  // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_SCOPED_PTR_H_