Bug 1020661: Ignore GCC warning Wunused-local-typedefs inside of webrtc's scoped_ptr.h header. r=jesup
--- 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_