~ubuntu-branches/ubuntu/jaunty/libcrypto++/jaunty

« back to all changes in this revision

Viewing changes to debian/config.h.in

  • Committer: Bazaar Package Importer
  • Author(s): Jens Peter Secher
  • Date: 2006-03-16 23:08:48 UTC
  • mfrom: (3.1.2 dapper)
  • Revision ID: james.westby@ubuntu.com-20060316230848-wwtupzit1dy23s7s
Tags: 5.2.1c2a-3
* Patch source so that it compiles with GCC 4.1 .  More specifically,
  avoid mixing implicit calls to base classes and free-standing
  functions.
  (Closes: #356170).
* Use LDFLAGS=-pthread to fix linking errors.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef CRYPTOPP_CONFIG_H
 
2
#define CRYPTOPP_CONFIG_H
 
3
 
 
4
// ***************** Important Settings ********************
 
5
 
 
6
// Endianness
 
7
#undef IS_BIG_ENDIAN
 
8
#undef IS_LITTLE_ENDIAN
 
9
 
 
10
// define this if you want to disable all OS-dependent features,
 
11
// such as sockets and OS-provided random number generators
 
12
// #define NO_OS_DEPENDENCE
 
13
 
 
14
// Define this to use features provided by Microsoft's CryptoAPI.
 
15
// Currently the only feature used is random number generation.
 
16
// This macro will be ignored if NO_OS_DEPENDENCE is defined.
 
17
#define USE_MS_CRYPTOAPI
 
18
 
 
19
// Define this to 1 to enforce the requirement in FIPS 186-2 Change Notice 1 that only 1024 bit moduli be used
 
20
#ifndef DSA_1024_BIT_MODULUS_ONLY
 
21
#       define DSA_1024_BIT_MODULUS_ONLY 1
 
22
#endif
 
23
 
 
24
// ***************** Less Important Settings ***************
 
25
 
 
26
// define this to retain (as much as possible) old deprecated function and class names
 
27
// #define CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY
 
28
 
 
29
#define GZIP_OS_CODE 0
 
30
 
 
31
// Try this if your CPU has 256K internal cache or a slow multiply instruction
 
32
// and you want a (possibly) faster IDEA implementation using log tables
 
33
// #define IDEA_LARGECACHE
 
34
 
 
35
// Define this if, for the linear congruential RNG, you want to use
 
36
// the original constants as specified in S.K. Park and K.W. Miller's
 
37
// CACM paper.
 
38
// #define LCRNG_ORIGINAL_NUMBERS
 
39
 
 
40
// choose which style of sockets to wrap (mostly useful for cygwin which has both)
 
41
#define PREFER_BERKELEY_STYLE_SOCKETS
 
42
// #define PREFER_WINDOWS_STYLE_SOCKETS
 
43
 
 
44
// ***************** Important Settings Again ********************
 
45
// But the defaults should be ok.
 
46
 
 
47
// namespace support is now required
 
48
#ifdef NO_NAMESPACE
 
49
#       error namespace support is now required
 
50
#endif
 
51
 
 
52
// Define this to workaround a Microsoft CryptoAPI bug where
 
53
// each call to CryptAcquireContext causes a 100 KB memory leak.
 
54
// Defining this will cause Crypto++ to make only one call to CryptAcquireContext.
 
55
#define WORKAROUND_MS_BUG_Q258000
 
56
 
 
57
#ifdef CRYPTOPP_DOXYGEN_PROCESSING
 
58
// Avoid putting "CryptoPP::" in front of everything in Doxygen output
 
59
#       define CryptoPP
 
60
#       define NAMESPACE_BEGIN(x)
 
61
#       define NAMESPACE_END
 
62
// Get Doxygen to generate better documentation for these typedefs
 
63
#       define DOCUMENTED_TYPEDEF(x, y) class y : public x {};
 
64
#else
 
65
#       define NAMESPACE_BEGIN(x) namespace x {
 
66
#       define NAMESPACE_END }
 
67
#       define DOCUMENTED_TYPEDEF(x, y) typedef x y;
 
68
#endif
 
69
#define ANONYMOUS_NAMESPACE_BEGIN namespace {
 
70
#define USING_NAMESPACE(x) using namespace x;
 
71
#define DOCUMENTED_NAMESPACE_BEGIN(x) namespace x {
 
72
#define DOCUMENTED_NAMESPACE_END }
 
73
 
 
74
// What is the type of the third parameter to bind?
 
75
// For Unix, the new standard is ::socklen_t (typically unsigned int), and the old standard is int.
 
76
// Unfortunately there is no way to tell whether or not socklen_t is defined.
 
77
// To work around this, TYPE_OF_SOCKLEN_T is a macro so that you can change it from the makefile.
 
78
#ifndef TYPE_OF_SOCKLEN_T
 
79
#       if defined(_WIN32) || defined(__CYGWIN__) || defined(__MACH__)
 
80
#               define TYPE_OF_SOCKLEN_T int
 
81
#       else
 
82
#               define TYPE_OF_SOCKLEN_T ::socklen_t
 
83
#       endif
 
84
#endif
 
85
 
 
86
#if defined(__CYGWIN__) && defined(PREFER_WINDOWS_STYLE_SOCKETS)
 
87
#       define __USE_W32_SOCKETS
 
88
#endif
 
89
 
 
90
typedef unsigned char byte;             // put in global namespace to avoid ambiguity with other byte typedefs
 
91
 
 
92
NAMESPACE_BEGIN(CryptoPP)
 
93
 
 
94
typedef unsigned short word16;
 
95
typedef unsigned int word32;
 
96
 
 
97
#if defined(__GNUC__) || defined(__MWERKS__)
 
98
        #define WORD64_AVAILABLE
 
99
        typedef unsigned long long word64;
 
100
        #define W64LIT(x) x##LL
 
101
#elif defined(_MSC_VER) || defined(__BCPLUSPLUS__)
 
102
        #define WORD64_AVAILABLE
 
103
        typedef unsigned __int64 word64;
 
104
        #define W64LIT(x) x##ui64
 
105
#endif
 
106
 
 
107
// define largest word type
 
108
#ifdef WORD64_AVAILABLE
 
109
        typedef word64 lword;
 
110
#else
 
111
        typedef word32 lword;
 
112
#endif
 
113
 
 
114
#if defined(__alpha__) || defined(__ia64__) || defined(_ARCH_PPC64) || defined(__x86_64__) || defined(__mips64)
 
115
        // These platforms have 64-bit CPU registers. Unfortunately most C++ compilers doesn't
 
116
        // allow any way to access the 64-bit by 64-bit multiply instruction without using
 
117
        // assembly, so in order to use word64 as word, the assembly instruction must be defined
 
118
        // in Dword::Multiply().
 
119
        typedef word32 hword;
 
120
        typedef word64 word;
 
121
#else
 
122
        #define CRYPTOPP_NATIVE_DWORD_AVAILABLE
 
123
        #ifdef WORD64_AVAILABLE
 
124
                #define CRYPTOPP_SLOW_WORD64 // defined this if your CPU is not 64-bit to use alternative code that avoids word64
 
125
                typedef word16 hword;
 
126
                typedef word32 word;
 
127
                typedef word64 dword;
 
128
        #else
 
129
                typedef word8 hword;
 
130
                typedef word16 word;
 
131
                typedef word32 dword;
 
132
        #endif
 
133
#endif
 
134
 
 
135
const unsigned int WORD_SIZE = sizeof(word);
 
136
const unsigned int WORD_BITS = WORD_SIZE * 8;
 
137
 
 
138
#if defined(_MSC_VER) || defined(__BCPLUSPLUS__)
 
139
        #define INTEL_INTRINSICS
 
140
        #define FAST_ROTATE
 
141
#elif defined(__MWERKS__) && TARGET_CPU_PPC
 
142
        #define PPC_INTRINSICS
 
143
        #define FAST_ROTATE
 
144
#elif defined(__GNUC__) && defined(__i386__)
 
145
        // GCC does peephole optimizations which should result in using rotate instructions
 
146
        #define FAST_ROTATE
 
147
#endif
 
148
 
 
149
NAMESPACE_END
 
150
 
 
151
// VC60 workaround: it doesn't allow typename in some places
 
152
#if defined(_MSC_VER) && (_MSC_VER < 1300)
 
153
#define CPP_TYPENAME
 
154
#else
 
155
#define CPP_TYPENAME typename
 
156
#endif
 
157
 
 
158
#ifdef _MSC_VER
 
159
#define CRYPTOPP_NO_VTABLE __declspec(novtable)
 
160
#else
 
161
#define CRYPTOPP_NO_VTABLE
 
162
#endif
 
163
 
 
164
#ifdef _MSC_VER
 
165
        // 4231: nonstandard extension used : 'extern' before template explicit instantiation
 
166
        // 4250: dominance
 
167
        // 4251: member needs to have dll-interface
 
168
        // 4275: base needs to have dll-interface
 
169
        // 4660: explicitly instantiating a class that's already implicitly instantiated
 
170
        // 4661: no suitable definition provided for explicit template instantiation request
 
171
        // 4786: identifer was truncated in debug information
 
172
        // 4355: 'this' : used in base member initializer list
 
173
#       pragma warning(disable: 4231 4250 4251 4275 4660 4661 4786 4355)
 
174
#endif
 
175
 
 
176
#if (defined(_MSC_VER) && _MSC_VER <= 1300) || defined(__MWERKS__) || defined(_STLPORT_VERSION)
 
177
#define CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION
 
178
#endif
 
179
 
 
180
#ifndef CRYPTOPP_DISABLE_UNCAUGHT_EXCEPTION
 
181
#define CRYPTOPP_UNCAUGHT_EXCEPTION_AVAILABLE
 
182
#endif
 
183
 
 
184
// CodeWarrior defines _MSC_VER
 
185
#if !defined(CRYPTOPP_DISABLE_X86ASM) && ((defined(_MSC_VER) && !defined(__MWERKS__) && defined(_M_IX86)) || (defined(__GNUC__) && defined(__i386__)))
 
186
#define CRYPTOPP_X86ASM_AVAILABLE
 
187
#endif
 
188
 
 
189
// ***************** determine availability of OS features ********************
 
190
 
 
191
#ifndef NO_OS_DEPENDENCE
 
192
 
 
193
#if defined(_WIN32) || defined(__CYGWIN__)
 
194
#define CRYPTOPP_WIN32_AVAILABLE
 
195
#endif
 
196
 
 
197
#if defined(__unix__) || defined(__MACH__)
 
198
#define CRYPTOPP_UNIX_AVAILABLE
 
199
#endif
 
200
 
 
201
#if defined(WORD64_AVAILABLE) && (defined(CRYPTOPP_WIN32_AVAILABLE) || defined(CRYPTOPP_UNIX_AVAILABLE))
 
202
#       define HIGHRES_TIMER_AVAILABLE
 
203
#endif
 
204
 
 
205
#ifdef CRYPTOPP_UNIX_AVAILABLE
 
206
#       define HAS_BERKELEY_STYLE_SOCKETS
 
207
#endif
 
208
 
 
209
#ifdef CRYPTOPP_WIN32_AVAILABLE
 
210
#       define HAS_WINDOWS_STYLE_SOCKETS
 
211
#endif
 
212
 
 
213
#if defined(HIGHRES_TIMER_AVAILABLE) && (defined(HAS_BERKELEY_STYLE_SOCKETS) || defined(HAS_WINDOWS_STYLE_SOCKETS))
 
214
#       define SOCKETS_AVAILABLE
 
215
#endif
 
216
 
 
217
#if defined(HAS_WINDOWS_STYLE_SOCKETS) && (!defined(HAS_BERKELEY_STYLE_SOCKETS) || defined(PREFER_WINDOWS_STYLE_SOCKETS))
 
218
#       define USE_WINDOWS_STYLE_SOCKETS
 
219
#else
 
220
#       define USE_BERKELEY_STYLE_SOCKETS
 
221
#endif
 
222
 
 
223
#if defined(CRYPTOPP_WIN32_AVAILABLE) && !defined(USE_BERKELEY_STYLE_SOCKETS)
 
224
#       define WINDOWS_PIPES_AVAILABLE
 
225
#endif
 
226
 
 
227
#if defined(CRYPTOPP_WIN32_AVAILABLE) && defined(USE_MS_CRYPTOAPI)
 
228
#       define NONBLOCKING_RNG_AVAILABLE
 
229
#       define OS_RNG_AVAILABLE
 
230
#endif
 
231
 
 
232
#if defined(CRYPTOPP_UNIX_AVAILABLE) || defined(CRYPTOPP_DOXYGEN_PROCESSING)
 
233
#       define NONBLOCKING_RNG_AVAILABLE
 
234
#       define BLOCKING_RNG_AVAILABLE
 
235
#       define OS_RNG_AVAILABLE
 
236
#       define HAS_PTHREADS
 
237
#       define THREADS_AVAILABLE
 
238
#endif
 
239
 
 
240
#ifdef CRYPTOPP_WIN32_AVAILABLE
 
241
#       define HAS_WINTHREADS
 
242
#       define THREADS_AVAILABLE
 
243
#endif
 
244
 
 
245
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
 
246
#       define CRYPTOPP_MALLOC_ALIGNMENT_IS_16
 
247
#endif
 
248
 
 
249
#if defined(__linux__) || defined(__sun__) || defined(__CYGWIN__)
 
250
#       define CRYPTOPP_MEMALIGN_AVAILABLE
 
251
#endif
 
252
 
 
253
#endif  // NO_OS_DEPENDENCE
 
254
 
 
255
// ***************** DLL related ********************
 
256
 
 
257
#ifdef CRYPTOPP_WIN32_AVAILABLE
 
258
 
 
259
#ifdef CRYPTOPP_EXPORTS
 
260
#define CRYPTOPP_IS_DLL
 
261
#define CRYPTOPP_DLL __declspec(dllexport)
 
262
#elif defined(CRYPTOPP_IMPORTS)
 
263
#define CRYPTOPP_IS_DLL
 
264
#define CRYPTOPP_DLL __declspec(dllimport)
 
265
#else
 
266
#define CRYPTOPP_DLL
 
267
#endif
 
268
 
 
269
#define CRYPTOPP_API __stdcall
 
270
#define CRYPTOPP_CDECL __cdecl
 
271
 
 
272
#else   // CRYPTOPP_WIN32_AVAILABLE
 
273
 
 
274
#define CRYPTOPP_DLL
 
275
#define CRYPTOPP_API
 
276
#define CRYPTOPP_CDECL
 
277
 
 
278
#endif  // CRYPTOPP_WIN32_AVAILABLE
 
279
 
 
280
#if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_IMPORTS)
 
281
#define CRYPTOPP_DLL_TEMPLATE_CLASS template class CRYPTOPP_DLL
 
282
#elif defined(__MWERKS__)
 
283
#define CRYPTOPP_DLL_TEMPLATE_CLASS extern class CRYPTOPP_DLL
 
284
#else
 
285
#define CRYPTOPP_DLL_TEMPLATE_CLASS extern template class CRYPTOPP_DLL
 
286
#endif
 
287
 
 
288
#if defined(CRYPTOPP_MANUALLY_INSTANTIATE_TEMPLATES) && !defined(CRYPTOPP_EXPORTS)
 
289
#define CRYPTOPP_STATIC_TEMPLATE_CLASS template class
 
290
#elif defined(__MWERKS__)
 
291
#define CRYPTOPP_STATIC_TEMPLATE_CLASS extern class
 
292
#else
 
293
#define CRYPTOPP_STATIC_TEMPLATE_CLASS extern template class
 
294
#endif
 
295
 
 
296
#endif