summaryrefslogtreecommitdiff
path: root/debian/patches/02-gcc-4.4-fixes.diff
blob: cab6c212b467053ece48fc0ee01d670eb2c34cc9 (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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
In order to compile with recent versions of gcc, some includes needs to be adjusted.

Some of the patches in this diff are required for gcc-4.3, some others
for gcc-4.4. I haven't disentagled which patch is required for what
exact version of gcc, but all of them are rather obvious and probably be
applied upstream.

--- a/bin/bbackupobjdump/bbackupobjdump.cpp
+++ b/bin/bbackupobjdump/bbackupobjdump.cpp
@@ -9,7 +9,8 @@
 
 #include "Box.h"
 
-#include <stdio.h>
+#include <cstdio>
+#include <cstring>
 
 #include "MainHelper.h"
 #include "FileStream.h"
--- a/bin/bbackupquery/bbackupquery.cpp
+++ b/bin/bbackupquery/bbackupquery.cpp
@@ -14,7 +14,8 @@
 #endif
 
 #include <errno.h>
-#include <stdio.h>
+#include <cstdio>
+#include <cstdlib>
 
 #ifdef HAVE_SYS_TYPES_H
 	#include <sys/types.h>
--- a/bin/bbstoreaccounts/bbstoreaccounts.cpp
+++ b/bin/bbstoreaccounts/bbstoreaccounts.cpp
@@ -36,6 +36,8 @@
 
 #include "MemLeakFindOn.h"
 
+#include <cstring>
+
 // max size of soft limit as percent of hard limit
 #define MAX_SOFT_LIMIT_SIZE		97
 
--- a/lib/backupclient/BackupClientFileAttributes.cpp
+++ b/lib/backupclient/BackupClientFileAttributes.cpp
@@ -28,6 +28,8 @@
 #include <sys/xattr.h>
 #endif
 
+#include <cstring>
+
 #include "BackupClientFileAttributes.h"
 #include "CommonException.h"
 #include "FileModificationTime.h"
--- a/lib/backupclient/BackupStoreFile.h
+++ b/lib/backupclient/BackupStoreFile.h
@@ -12,6 +12,7 @@
 
 #include <cstdlib>
 #include <memory>
+#include <cstdlib>
 
 #include "BackupClientFileAttributes.h"
 #include "BackupStoreFilename.h"
--- a/lib/backupclient/BackupStoreFileDiff.cpp
+++ b/lib/backupclient/BackupStoreFileDiff.cpp
@@ -35,6 +35,8 @@
 
 #include "MemLeakFindOn.h"
 
+#include <cstring>
+
 using namespace BackupStoreFileCryptVar;
 using namespace BackupStoreFileCreation;
 
--- a/lib/backupclient/BackupStoreFileEncodeStream.cpp
+++ b/lib/backupclient/BackupStoreFileEncodeStream.cpp
@@ -26,6 +26,8 @@
 
 #include "MemLeakFindOn.h"
 
+#include <cstring>
+
 using namespace BackupStoreFileCryptVar;
 
 
--- a/lib/common/Configuration.cpp
+++ b/lib/common/Configuration.cpp
@@ -22,6 +22,8 @@
 
 #include "MemLeakFindOn.h"
 
+#include <cstring>
+
 // utility whitespace function
 inline bool iw(int c)
 {
--- a/lib/common/DebugMemLeakFinder.cpp
+++ b/lib/common/DebugMemLeakFinder.cpp
@@ -24,6 +24,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <set>
+#include <cstdlib> // for std::atexit
 
 #include "MemLeakFinder.h"
 
@@ -130,7 +131,7 @@ void *memleakfinder_malloc(size_t size, 
 {
 	InternalAllocGuard guard;
 
-	void *b = ::malloc(size);
+	void *b = std::malloc(size);
 	if(!memleakfinder_global_enable) return b;
 	if(!memleakfinder_initialised)   return b;
 
@@ -146,7 +147,7 @@ void *memleakfinder_realloc(void *ptr, s
 
 	if(!memleakfinder_global_enable || !memleakfinder_initialised)
 	{
-		return ::realloc(ptr, size);
+		return std::realloc(ptr, size);
 	}
 
 	// Check it's been allocated
@@ -158,7 +159,7 @@ void *memleakfinder_realloc(void *ptr, s
 			"objects?");
 	}
 
-	void *b = ::realloc(ptr, size);
+	void *b = std::realloc(ptr, size);
 
 	if(ptr && i!=sMallocBlocks.end())
 	{
@@ -215,7 +216,7 @@ void memleakfinder_free(void *ptr)
 	}
 
 	//TRACE1("free(), %08x\n", ptr);
-	::free(ptr);
+	std::free(ptr);
 }
 
 
@@ -426,7 +427,7 @@ void memleakfinder_setup_exit_report(con
 	atexit_markertext[sizeof(atexit_markertext)-1] = 0;
 	if(!atexit_registered)
 	{
-		atexit(memleakfinder_atexit);
+		std::atexit(memleakfinder_atexit);
 		atexit_registered = true;
 	}
 }
@@ -490,7 +491,7 @@ static void *internal_new(size_t size, c
 
 	{
 		InternalAllocGuard guard;
-		r = ::malloc(size);
+		r = std::malloc(size);
 	}
 	
 	if (sInternalAllocDepth == 0)
@@ -533,7 +534,7 @@ void internal_delete(void *ptr)
 {
 	InternalAllocGuard guard;
 
-	::free(ptr);
+	std::free(ptr);
 	remove_object_block(ptr);
 	//TRACE1("delete[]() called, %08x\n", ptr);
 }
--- a/lib/common/MemLeakFinder.h
+++ b/lib/common/MemLeakFinder.h
@@ -12,7 +12,7 @@
 
 #ifdef MEMLEAKFINDER_FULL_MALLOC_MONITORING
 	// include stdlib now, to avoid problems with having the macros defined already
-	#include <stdlib.h>
+	#include <cstdlib>
 #endif
 
 // global enable flag
--- a/lib/common/StreamableMemBlock.cpp
+++ b/lib/common/StreamableMemBlock.cpp
@@ -10,7 +10,7 @@
 #include "Box.h"
 
 #include <new>
-#include <stdlib.h>
+#include <cstdlib>
 #include <string.h>
 
 #include "StreamableMemBlock.h"
--- a/lib/common/Test.h
+++ b/lib/common/Test.h
@@ -10,7 +10,7 @@
 #ifndef TEST__H
 #define TEST__H
 
-#include <string>
+#include <cstring>
 
 #ifdef WIN32
 #define BBACKUPCTL      "..\\..\\bin\\bbackupctl\\bbackupctl.exe"
--- a/lib/common/WaitForEvent.h
+++ b/lib/common/WaitForEvent.h
@@ -22,6 +22,8 @@
 	#endif
 #endif
 
+#include <cstdlib>
+
 #include "CommonException.h"
 
 #include "MemLeakFindOn.h"
--- a/lib/raidfile/RaidFileRead.h
+++ b/lib/raidfile/RaidFileRead.h
@@ -10,7 +10,8 @@
 #ifndef RAIDFILEREAD__H
 #define RAIDFILEREAD__H
 
-#include <string>
+#include <cstring>
+#include <cstdlib>
 #include <memory>
 #include <vector>
 
--- a/lib/common/Logging.cpp
+++ b/lib/common/Logging.cpp
@@ -11,6 +11,10 @@
 
 #include <errno.h>
 #include <time.h>
+#include <string.h> // for stderror
+
+// c.f. http://bugs.debian.org/512510
+#include <cstdio>
 
 #ifdef HAVE_SYSLOG_H
 	#include <syslog.h>
--- a/bin/bbackupctl/bbackupctl.cpp
+++ b/bin/bbackupctl/bbackupctl.cpp
@@ -9,7 +9,8 @@
 
 #include "Box.h"
 
-#include <stdio.h>
+#include <cstdio>
+#include <cstdlib>
 
 #ifdef HAVE_UNISTD_H
 	#include <unistd.h>