Silence -Wdeprecated-declarations in GCC 4.7+.

Change-Id: I63a8bdb0649452a8e50b579f61bc4ea5d7e294f7
diff --git a/common/hdr_util.h b/common/hdr_util.h
index 3ef5388..c414aaf 100644
--- a/common/hdr_util.h
+++ b/common/hdr_util.h
@@ -48,14 +48,18 @@
 };
 
 // disable deprecation warnings for auto_ptr
-#if defined(__GNUC__) && __GNUC__ >= 5
+#if defined(__GNUC__)
+#if __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #endif
+#endif
 typedef std::auto_ptr<mkvmuxer::PrimaryChromaticity> PrimaryChromaticityPtr;
-#if defined(__GNUC__) && __GNUC__ >= 5
+#if defined(__GNUC__)
+#if __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)
 #pragma GCC diagnostic pop
 #endif
+#endif
 
 bool CopyPrimaryChromaticity(const mkvparser::PrimaryChromaticity& parser_pc,
                              PrimaryChromaticityPtr* muxer_pc);
diff --git a/mkvmuxer/mkvmuxer.cc b/mkvmuxer/mkvmuxer.cc
index 41732fb..71f026a 100644
--- a/mkvmuxer/mkvmuxer.cc
+++ b/mkvmuxer/mkvmuxer.cc
@@ -27,9 +27,11 @@
 #include "mkvparser/mkvparser.h"
 
 // disable deprecation warnings for auto_ptr
-#if defined(__GNUC__) && __GNUC__ >= 5
+#if defined(__GNUC__)
+#if __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #endif
+#endif
 
 namespace mkvmuxer {
 
diff --git a/mkvparser/mkvparser.cc b/mkvparser/mkvparser.cc
index d8b2343..d4f8e5e 100644
--- a/mkvparser/mkvparser.cc
+++ b/mkvparser/mkvparser.cc
@@ -23,9 +23,11 @@
 #include "common/webmids.h"
 
 // disable deprecation warnings for auto_ptr
-#if defined(__GNUC__) && __GNUC__ >= 5
+#if defined(__GNUC__)
+#if __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #endif
+#endif
 
 namespace mkvparser {
 const float MasteringMetadata::kValueNotPresent = FLT_MAX;
diff --git a/mkvparser_sample.cc b/mkvparser_sample.cc
index fbd125d..6f7dc00 100644
--- a/mkvparser_sample.cc
+++ b/mkvparser_sample.cc
@@ -17,9 +17,11 @@
 #include "mkvparser/mkvreader.h"
 
 // disable deprecation warnings for auto_ptr
-#if defined(__GNUC__) && __GNUC__ >= 5
+#if defined(__GNUC__)
+#if __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #endif
+#endif
 
 namespace {
 const wchar_t* utf8towcs(const char* str) {
diff --git a/vttdemux.cc b/vttdemux.cc
index 47529e2..62f987d 100644
--- a/vttdemux.cc
+++ b/vttdemux.cc
@@ -21,9 +21,11 @@
 using std::string;
 
 // disable deprecation warnings for auto_ptr
-#if defined(__GNUC__) && __GNUC__ >= 5
+#if defined(__GNUC__)
+#if __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #endif
+#endif
 
 namespace libwebm {
 namespace vttdemux {