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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
|
--- steghide-0.5.1.old/configure.in 2003-10-15 09:48:52.000000000 +0200
+++ steghide-0.5.1.new/configure.in 2008-05-09 19:04:46.000000000 +0200
@@ -7,27 +7,26 @@
dnl checks for programs.
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_AWK
AC_PROG_LN_S
+AC_CXX_COMPILE_STDCXX_0X
dnl GNU gettext
AC_CHECK_FUNCS(strchr)
AM_GNU_GETTEXT
AM_CONDITIONAL(USE_INTLDIR, test "$nls_cv_use_gnu_gettext" = yes)
dnl check if debugging support is requested
-AC_MSG_CHECKING([wether to enable debugging])
+AC_MSG_CHECKING([whether to enable debugging])
AC_ARG_ENABLE(debug,[ --enable-debug enable debugging],
if test "$enableval" = yes ;
then
AC_MSG_RESULT([yes])
AC_DEFINE(DEBUG,1,[enable code used only for debugging])
- CXXFLAGS="-O2 -Wall -g"
else
AC_MSG_RESULT([no])
- CXXFLAGS="-O2 -Wall"
fi
,
AC_MSG_RESULT([no])
CXXFLAGS="-O2 -Wall"
)
@@ -213,7 +212,18 @@
echo "libmhash can be downloaded from http://mhash.sourceforge.net/.";
echo "**********";
AC_MSG_ERROR([[libmhash not found]])
fi
+dnl Should we add std=c++0x?
+
+if test "$ac_cv_cxx_compile_cxx0x_cxx" = yes;
+then
+ CXXFLAGS="${CXXFLAGS} -std=c++0x -Wall -Wextra"
+else
+ CXXFLAGS="${CXXFLAGS} -Wall -Wextra"
+fi
+
+AC_SUBST(CXXFLAGS)
+
dnl create Makefiles
AC_OUTPUT([Makefile steghide.spec steghide.doxygen doc/Makefile po/Makefile.in src/Makefile tests/Makefile tests/data/Makefile m4/Makefile intl/Makefile])
--- steghide-0.5.1.old/m4/ac_cxx_compile_stdcxx_0x.m4 1970-01-01 01:00:00.000000000 +0100
+++ steghide-0.5.1.new/m4/ac_cxx_compile_stdcxx_0x.m4 2008-05-09 19:04:46.000000000 +0200
@@ -0,0 +1,107 @@
+# ===========================================================================
+# http://autoconf-archive.cryp.to/ac_cxx_compile_stdcxx_0x.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AC_CXX_COMPILE_STDCXX_0X
+#
+# DESCRIPTION
+#
+# Check for baseline language coverage in the compiler for the C++0x
+# standard.
+#
+# LAST MODIFICATION
+#
+# 2008-04-17
+#
+# COPYLEFT
+#
+# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved.
+
+AC_DEFUN([AC_CXX_COMPILE_STDCXX_0X], [
+ AC_CACHE_CHECK(if g++ supports C++0x features without additional flags,
+ ac_cv_cxx_compile_cxx0x_native,
+ [AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE([
+ template <typename T>
+ struct check
+ {
+ static_assert(sizeof(int) <= sizeof(T), "not big enough");
+ };
+
+ typedef check<check<bool>> right_angle_brackets;
+
+ int a;
+ decltype(a) b;
+
+ typedef check<int> check_type;
+ check_type c;
+ check_type&& cr = c;],,
+ ac_cv_cxx_compile_cxx0x_native=yes, ac_cv_cxx_compile_cxx0x_native=no)
+ AC_LANG_RESTORE
+ ])
+
+ AC_CACHE_CHECK(if g++ supports C++0x features with -std=c++0x,
+ ac_cv_cxx_compile_cxx0x_cxx,
+ [AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -std=c++0x"
+ AC_TRY_COMPILE([
+ template <typename T>
+ struct check
+ {
+ static_assert(sizeof(int) <= sizeof(T), "not big enough");
+ };
+
+ typedef check<check<bool>> right_angle_brackets;
+
+ int a;
+ decltype(a) b;
+
+ typedef check<int> check_type;
+ check_type c;
+ check_type&& cr = c;],,
+ ac_cv_cxx_compile_cxx0x_cxx=yes, ac_cv_cxx_compile_cxx0x_cxx=no)
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ AC_LANG_RESTORE
+ ])
+
+ AC_CACHE_CHECK(if g++ supports C++0x features with -std=gnu++0x,
+ ac_cv_cxx_compile_cxx0x_gxx,
+ [AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -std=gnu++0x"
+ AC_TRY_COMPILE([
+ template <typename T>
+ struct check
+ {
+ static_assert(sizeof(int) <= sizeof(T), "not big enough");
+ };
+
+ typedef check<check<bool>> right_angle_brackets;
+
+ int a;
+ decltype(a) b;
+
+ typedef check<int> check_type;
+ check_type c;
+ check_type&& cr = c;],,
+ ac_cv_cxx_compile_cxx0x_gxx=yes, ac_cv_cxx_compile_cxx0x_gxx=no)
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ AC_LANG_RESTORE
+ ])
+
+ if test "$ac_cv_cxx_compile_cxx0x_native" = yes ||
+ test "$ac_cv_cxx_compile_cxx0x_cxx" = yes ||
+ test "$ac_cv_cxx_compile_cxx0x_gxx" = yes; then
+ AC_DEFINE(HAVE_STDCXX_0X,,[Define if g++ supports C++0x features. ])
+ fi
+])
--- steghide-0.5.1.old/src/Arguments.cc 2003-10-11 23:25:04.000000000 +0200
+++ steghide-0.5.1.new/src/Arguments.cc 2008-05-09 19:04:44.000000000 +0200
@@ -26,10 +26,12 @@
#include "Terminal.h"
#include "common.h"
#include "error.h"
#include "msg.h"
+float Arguments::Default_Goal = 100.0 ;
+
// the global Arguments object
Arguments Args ;
Arguments::Arguments (int argc, char* argv[])
{
--- steghide-0.5.1.old/src/Arguments.h 2003-10-11 23:23:57.000000000 +0200
+++ steghide-0.5.1.new/src/Arguments.h 2008-05-09 19:04:44.000000000 +0200
@@ -98,11 +98,11 @@
static const bool Default_EmbedEmbFn = true ;
static const bool Default_Force = false ;
static const VERBOSITY Default_Verbosity = NORMAL ;
static const unsigned long Default_Radius = 0 ; // there is no default radius for all file formats
static const unsigned int Max_Algorithm = 3 ;
- static const float Default_Goal = 100.0 ;
+ static float Default_Goal ;
static const DEBUGCOMMAND Default_DebugCommand = NONE ;
static const bool Default_Check = false ;
static const unsigned int Default_DebugLevel = 0 ;
static const unsigned int Default_GmlGraphRecDepth = 0 ;
static const unsigned int Default_GmlStartVertex = 0 ;
--- steghide-0.5.1.old/src/EncryptionMode.h 2003-09-28 17:30:30.000000000 +0200
+++ steghide-0.5.1.new/src/EncryptionMode.h 2008-05-09 19:04:46.000000000 +0200
@@ -69,11 +69,11 @@
static const unsigned int NumValues = 8 ;
IRep Value ;
typedef struct struct_Translation {
IRep irep ;
- char* srep ;
+ const char* srep ;
} Translation ;
static const Translation Translations[] ;
} ;
#endif // ndef SH_ENCMODE_H
--- steghide-0.5.1.old/src/Graph.cc 2003-10-11 23:54:26.000000000 +0200
+++ steghide-0.5.1.new/src/Graph.cc 2008-05-09 19:04:46.000000000 +0200
@@ -20,10 +20,12 @@
#include <ctime>
#include <list>
#include <map>
#include <vector>
+#include <algorithm>
+#include <climits>
#include "BitString.h"
#include "CvrStgFile.h"
#include "Edge.h"
#include "Graph.h"
--- steghide-0.5.1.old/src/Matching.cc 2003-10-11 23:54:30.000000000 +0200
+++ steghide-0.5.1.new/src/Matching.cc 2008-05-09 19:04:46.000000000 +0200
@@ -16,10 +16,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
+#include <algorithm>
#include "Edge.h"
#include "Graph.h"
#include "Matching.h"
#include "ProgressOutput.h"
#include "common.h"
--- steghide-0.5.1.old/src/ProgressOutput.cc 2003-10-11 11:20:51.000000000 +0200
+++ steghide-0.5.1.new/src/ProgressOutput.cc 2008-05-09 19:04:44.000000000 +0200
@@ -21,10 +21,12 @@
#include <cmath>
#include "ProgressOutput.h"
#include "common.h"
+float ProgressOutput::NoAvgWeight = 1.0 ;
+
ProgressOutput::ProgressOutput ()
: Message("__nomessage__")
{
LastUpdate = time(NULL) - 1 ; // -1 to ensure that message is written first time
}
--- steghide-0.5.1.old/src/ProgressOutput.h 2003-09-28 17:30:30.000000000 +0200
+++ steghide-0.5.1.new/src/ProgressOutput.h 2008-05-09 19:04:44.000000000 +0200
@@ -60,13 +60,13 @@
/**
* update the output appending rate, [average edge weight], "done" and a newline
* \param rate the rate of matched vertices
* \param avgweight the average edge weight (is not printed if not given)
**/
- void done (float rate, float avgweight = NoAvgWeight) const ;
+ void done (float rate, float avgweight = 1.0) const ;
- static const float NoAvgWeight = -1.0 ;
+ static float NoAvgWeight ;
protected:
std::string vcompose (const char *msgfmt, va_list ap) const ;
private:
--- steghide-0.5.1.old/src/SMDConstructionHeuristic.cc 2003-09-28 17:30:30.000000000 +0200
+++ steghide-0.5.1.new/src/SMDConstructionHeuristic.cc 2008-05-09 19:04:46.000000000 +0200
@@ -16,10 +16,12 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
+#include <algorithm>
+
#include "Edge.h"
#include "Graph.h"
#include "Matching.h"
#include "SMDConstructionHeuristic.h"
#include "Vertex.h"
--- steghide-0.5.1.old/src/WavFile.cc 2003-09-28 17:30:30.000000000 +0200
+++ steghide-0.5.1.new/src/WavFile.cc 2008-05-09 19:04:46.000000000 +0200
@@ -19,10 +19,11 @@
*/
#include <cstdio>
#include <cstdlib>
#include <cstring>
+#include <algorithm>
#include "CvrStgFile.h"
#include "DFSAPHeuristic.h"
#include "SampleValueAdjacencyList.h"
#include "SMDConstructionHeuristic.h"
--- steghide-0.5.1.old/src/wrapper_hash_map.h 2003-09-28 17:30:30.000000000 +0200
+++ steghide-0.5.1.new/src/wrapper_hash_map.h 2008-05-09 19:04:46.000000000 +0200
@@ -25,17 +25,21 @@
#ifdef __GNUC__
# if __GNUC__ < 3
# include <hash_map.h>
namespace sgi { using ::hash ; using ::hash_map ; } ;
-# else
+# elif __GNUC__ == 3 || ( __GNUC__ == 4 && __GNUC_MINOR__ < 3 )
# include <ext/hash_map>
-# if __GNUC_MINOR__ == 0
+# if __GNUC__ == 3 && __GNUC_MINOR__ == 0
namespace sgi = std ; // GCC 3.0
# else
namespace sgi = __gnu_cxx ; // GCC 3.1 and later
# endif
+# else
+# include <unordered_map>
+# define hash_map unordered_map
+ namespace sgi = std ;
# endif
#else
namespace sgi = std ;
#endif
--- steghide-0.5.1.old/src/wrapper_hash_set.h 2003-09-28 17:30:30.000000000 +0200
+++ steghide-0.5.1.new/src/wrapper_hash_set.h 2008-05-09 19:04:46.000000000 +0200
@@ -26,17 +26,21 @@
#ifdef __GNUC__
# if __GNUC__ < 3
# include <hash_set.h>
namespace sgi { using ::hash ; using ::hash_set ; } ;
-# else
+# elif __GNUC__ == 3 || ( __GNUC__ == 4 && __GNUC_MINOR__ < 3 )
# include <ext/hash_set>
-# if __GNUC_MINOR__ == 0
+# if __GNUC__ == 3 && __GNUC_MINOR__ == 0
namespace sgi = std ; // GCC 3.0
# else
namespace sgi = ::__gnu_cxx ; // GCC 3.1 and later
# endif
+# else
+# include <unordered_set>
+# define hash_set unordered_set
+ namespace sgi = std ;
# endif
#else
namespace sgi = std ;
#endif
|