aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/apt/apt-1.0.9.9/0001-fix-the-gcc-version-check.patch
blob: beea56d2aee03ea0c6adc065d48f163a953b23dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
From 15c6ef6a827d3681ad06e862d27ab3dfb84cb687 Mon Sep 17 00:00:00 2001
From: Roy Li <rongqing.li@windriver.com>
Date: Wed, 27 May 2015 14:30:28 +0800
Subject: [PATCH] fix the gcc version check

Upstream-Status: pending

"GCC diagnostic push" is gcc 4.6 feature, gcc 4.4.7 on centos did not know it

Signed-off-by: Roy Li <rongqing.li@windriver.com>
---
 apt-pkg/cacheset.h           |  4 ++--
 apt-pkg/deb/debsrcrecords.cc | 12 ++++++------
 apt-pkg/srcrecords.cc        |  4 ++--
 apt-pkg/srcrecords.h         |  4 ++--
 apt-pkg/vendorlist.cc        |  4 ++--
 5 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h
index b7229bc..8cc2917 100644
--- a/apt-pkg/cacheset.h
+++ b/apt-pkg/cacheset.h
@@ -119,12 +119,12 @@ public:
 		inline std::string FullName(bool const Pretty) const { return getPkg().FullName(Pretty); }
 		inline std::string FullName() const { return getPkg().FullName(); }
 		APT_DEPRECATED inline const char *Section() const {
-#if __GNUC__ >= 4
+#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
 	#pragma GCC diagnostic push
 	#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #endif
 	   return getPkg().Section();
-#if __GNUC__ >= 4
+#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
 	#pragma GCC diagnostic pop
 #endif
 		}
diff --git a/apt-pkg/deb/debsrcrecords.cc b/apt-pkg/deb/debsrcrecords.cc
index 49a348d..4bc9dcf 100644
--- a/apt-pkg/deb/debsrcrecords.cc
+++ b/apt-pkg/deb/debsrcrecords.cc
@@ -126,13 +126,13 @@ bool debSrcRecordParser::Files(std::vector<pkgSrcRecords::File> &F)
    for (std::vector<pkgSrcRecords::File2>::const_iterator f2 = F2.begin(); f2 != F2.end(); ++f2)
    {
       pkgSrcRecords::File2 f;
-#if __GNUC__ >= 4
+#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
 	#pragma GCC diagnostic push
 	#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #endif
       f.MD5Hash = f2->MD5Hash;
       f.Size = f2->Size;
-#if __GNUC__ >= 4
+#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
 	#pragma GCC diagnostic pop
 #endif
       f.Path = f2->Path;
@@ -190,14 +190,14 @@ bool debSrcRecordParser::Files2(std::vector<pkgSrcRecords::File2> &List)
 	 // we have it already, store the new hash and be done
 	 if (file != List.end())
 	 {
-#if __GNUC__ >= 4
+#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
 	// set for compatibility only, so warn users not us
 	#pragma GCC diagnostic push
 	#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #endif
 	    if (checksumField == "Files")
 	       file->MD5Hash = hash;
-#if __GNUC__ >= 4
+#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
 	#pragma GCC diagnostic pop
 #endif
 	    // an error here indicates that we have two different hashes for the same file
@@ -212,7 +212,7 @@ bool debSrcRecordParser::Files2(std::vector<pkgSrcRecords::File2> &List)
 	 F.FileSize = strtoull(size.c_str(), NULL, 10);
 	 F.Hashes.push_back(hashString);
 
-#if __GNUC__ >= 4
+#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
 	// set for compatibility only, so warn users not us
 	#pragma GCC diagnostic push
 	#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
@@ -220,7 +220,7 @@ bool debSrcRecordParser::Files2(std::vector<pkgSrcRecords::File2> &List)
 	 F.Size = F.FileSize;
 	 if (checksumField == "Files")
 	    F.MD5Hash = hash;
-#if __GNUC__ >= 4
+#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
 	#pragma GCC diagnostic pop
 #endif
 
diff --git a/apt-pkg/srcrecords.cc b/apt-pkg/srcrecords.cc
index 3175ee7..340e796 100644
--- a/apt-pkg/srcrecords.cc
+++ b/apt-pkg/srcrecords.cc
@@ -160,7 +160,7 @@ bool pkgSrcRecords::Parser::Files2(std::vector<pkgSrcRecords::File2> &F2)/*{{{*/
    for (std::vector<pkgSrcRecords::File>::const_iterator f = F.begin(); f != F.end(); ++f)
    {
       pkgSrcRecords::File2 f2;
-#if __GNUC__ >= 4
+#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
 	#pragma GCC diagnostic push
 	#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #endif
@@ -168,7 +168,7 @@ bool pkgSrcRecords::Parser::Files2(std::vector<pkgSrcRecords::File2> &F2)/*{{{*/
       f2.Size = f->Size;
       f2.Hashes.push_back(HashString("MD5Sum", f->MD5Hash));
       f2.FileSize = f->Size;
-#if __GNUC__ >= 4
+#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
 	#pragma GCC diagnostic pop
 #endif
       f2.Path = f->Path;
diff --git a/apt-pkg/srcrecords.h b/apt-pkg/srcrecords.h
index dde22bd..91f8061 100644
--- a/apt-pkg/srcrecords.h
+++ b/apt-pkg/srcrecords.h
@@ -30,7 +30,7 @@ class pkgSrcRecords
 {
    public:
 
-#if __GNUC__ >= 4
+#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
 	// ensure that con- & de-structor don't trigger this warning
 	#pragma GCC diagnostic push
 	#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
@@ -48,7 +48,7 @@ class pkgSrcRecords
       unsigned long long FileSize;
       HashStringList Hashes;
    };
-#if __GNUC__ >= 4
+#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
 	#pragma GCC diagnostic pop
 #endif
 
diff --git a/apt-pkg/vendorlist.cc b/apt-pkg/vendorlist.cc
index fb33ff1..ba1d3c3 100644
--- a/apt-pkg/vendorlist.cc
+++ b/apt-pkg/vendorlist.cc
@@ -11,7 +11,7 @@
 
 #include <apti18n.h>
 
-#if __GNUC__ >= 4
+#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
 	#pragma GCC diagnostic push
 	#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #endif
@@ -163,6 +163,6 @@ const Vendor* pkgVendorList::FindVendor(const std::vector<string> GPGVOutput)	/*
 }
 									/*}}}*/
 
-#if __GNUC__ >= 4
+#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
 	#pragma GCC diagnostic pop
 #endif
-- 
1.9.1