1 kumpf 1.69 /*
|
2 karl 1.61 //%2006////////////////////////////////////////////////////////////////////////
|
3 mike 1.18 //
|
4 karl 1.51 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
5 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
6 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
|
7 karl 1.45 // IBM Corp.; EMC Corporation, The Open Group.
|
8 karl 1.51 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
9 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
|
10 karl 1.53 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
11 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
12 karl 1.61 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
13 // EMC Corporation; Symantec Corporation; The Open Group.
|
14 mike 1.18 //
15 // Permission is hereby granted, free of charge, to any person obtaining a copy
|
16 karl 1.26 // of this software and associated documentation files (the "Software"), to
17 // deal in the Software without restriction, including without limitation the
18 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
19 mike 1.18 // sell copies of the Software, and to permit persons to whom the Software is
20 // furnished to do so, subject to the following conditions:
|
21 kumpf 1.29 //
|
22 karl 1.26 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
|
23 mike 1.18 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
24 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
25 karl 1.26 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
26 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
27 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
28 mike 1.18 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
29 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 //
31 //==============================================================================
32 //
33 //%/////////////////////////////////////////////////////////////////////////////
|
34 kumpf 1.69 */
|
35 mike 1.18
36 #ifndef Pegasus_Config_h
37 #define Pegasus_Config_h
38
39 #if defined(PEGASUS_PLATFORM_WIN32_IX86_MSVC)
40 # include <Pegasus/Common/Platform_WIN32_IX86_MSVC.h>
|
41 a.dunfey 1.68 #elif defined(PEGASUS_PLATFORM_WIN64_IA64_MSVC)
42 # include <Pegasus/Common/Platform_WIN64_IA64_MSVC.h>
43 #elif defined(PEGASUS_PLATFORM_WIN64_X86_64_MSVC)
44 # include <Pegasus/Common/Platform_WIN64_X86_64_MSVC.h>
|
45 mike 1.18 #elif defined (PEGASUS_PLATFORM_LINUX_IX86_GNU)
46 # include <Pegasus/Common/Platform_LINUX_IX86_GNU.h>
|
47 jim.wunderlich 1.59 #elif defined (PEGASUS_PLATFORM_LINUX_XSCALE_GNU)
48 # include <Pegasus/Common/Platform_LINUX_XSCALE_GNU.h>
|
49 mike 1.18 #elif defined (PEGASUS_PLATFORM_AIX_RS_IBMCXX)
50 # include <Pegasus/Common/Platform_AIX_RS_IBMCXX.h>
51 #elif defined (PEGASUS_PLATFORM_HPUX_PARISC_ACC)
52 # include <Pegasus/Common/Platform_HPUX_PARISC_ACC.h>
|
53 kumpf 1.36 #elif defined (PEGASUS_PLATFORM_HPUX_IA64_ACC)
54 # include <Pegasus/Common/Platform_HPUX_IA64_ACC.h>
|
55 mike 1.19 #elif defined (PEGASUS_PLATFORM_TRU64_ALPHA_DECCXX)
56 # include <Pegasus/Common/Platform_TRU64_ALPHA_DECCXX.h>
|
57 mike 1.21 #elif defined (PEGASUS_PLATFORM_SOLARIS_SPARC_GNU)
58 # include <Pegasus/Common/Platform_SOLARIS_SPARC_GNU.h>
|
59 keith.petley 1.43 #elif defined (PEGASUS_PLATFORM_SOLARIS_SPARC_CC)
60 # include <Pegasus/Common/Platform_SOLARIS_SPARC_CC.h>
|
61 mike 1.22 #elif defined (PEGASUS_PLATFORM_ZOS_ZSERIES_IBM)
62 # include <Pegasus/Common/Platform_ZOS_ZSERIES_IBM.h>
|
63 kumpf 1.27 #elif defined (PEGASUS_PLATFORM_LINUX_IA64_GNU)
64 # include <Pegasus/Common/Platform_LINUX_IA64_GNU.h>
|
65 w.otsuka 1.58 #elif defined (PEGASUS_PLATFORM_LINUX_X86_64_GNU)
66 # include <Pegasus/Common/Platform_LINUX_X86_64_GNU.h>
|
67 david.eger 1.41 #elif defined (PEGASUS_PLATFORM_LINUX_PPC_GNU)
68 # include <Pegasus/Common/Platform_LINUX_PPC_GNU.h>
|
69 jenny.yu 1.55 #elif defined (PEGASUS_PLATFORM_LINUX_PPC64_GNU)
70 # include <Pegasus/Common/Platform_LINUX_PPC64_GNU.h>
|
71 david.eger 1.42 #elif defined (PEGASUS_PLATFORM_LINUX_ZSERIES_GNU)
72 # include <Pegasus/Common/Platform_LINUX_ZSERIES_GNU.h>
|
73 jenny.yu 1.55 #elif defined (PEGASUS_PLATFORM_LINUX_ZSERIES64_GNU)
74 # include <Pegasus/Common/Platform_LINUX_ZSERIES64_GNU.h>
|
75 dudhe.girish 1.47 #elif defined (PEGASUS_PLATFORM_DARWIN_PPC_GNU)
76 # include <Pegasus/Common/Platform_DARWIN_PPC_GNU.h>
|
77 mike 1.67 #elif defined (PEGASUS_PLATFORM_DARWIN_IX86_GNU)
78 # include <Pegasus/Common/Platform_DARWIN_IX86_GNU.h>
|
79 gs.keenan 1.54 #elif defined (PEGASUS_PLATFORM_VMS_ALPHA_DECCXX)
80 # include <Pegasus/Common/Platform_VMS_ALPHA_DECCXX.h>
81 #elif defined (PEGASUS_PLATFORM_VMS_IA64_DECCXX)
82 # include <Pegasus/Common/Platform_VMS_IA64_DECCXX.h>
|
83 jim.wunderlich 1.59 #elif defined (PEGASUS_PLATFORM_LINUX_XSCALE_GNU)
84 # include <Pegasus/Common/Platform_LINUX_XSCALE_GNU.h>
|
85 mike 1.18 #else
86 # error "<Pegasus/Common/Config.h>: Unsupported Platform"
87 #endif
88
|
89 mday 1.39
90
|
91 kumpf 1.69 /*
|
92 mday 1.39 //<<< Sun Apr 6 19:28:00 2003 mdd >>>
93 //
94 // COMPILER Checks
95 //
96 // This is to allow a check for GCC > 3.2
97 // It needs to be the first thing we check because the next lines load
98 // further source files
|
99 kumpf 1.69 */
|
100 mday 1.39
101 #if defined(__GNUC__)
102 #define GCC_VERSION (__GNUC__ * 10000 \
103 + __GNUC_MINOR__ * 100 \
104 + __GNUC_PATCHLEVEL__)
105
|
106 kumpf 1.69 /*
|
107 mday 1.39 // To test for GCC > 3.2.0:
108 // #if GCC_VERSION > 30200
|
109 kumpf 1.69 */
|
110 mday 1.39
|
111 kumpf 1.65 #endif
|
112 mday 1.39
113
|
114 david.dillard 1.56 #ifdef __cplusplus
|
115 mike 1.22 #include <cstdlib>
|
116 david.dillard 1.56 #endif
|
117 mike 1.22
|
118 mike 1.62 #ifndef PEGASUS_IMPORT
119 # define PEGASUS_IMPORT /* empty */
120 #endif
121
|
122 kumpf 1.32 #ifndef PEGASUS_EXPORT
|
123 mike 1.62 # define PEGASUS_EXPORT /* empty */
124 #endif
125
126 /*
127 **==============================================================================
128 **
129 ** PEGASUS_HIDDEN_LINKAGE
130 **
131 ** This macro suppresses the export of a symbol in contexts in which the
132 ** default linkage would have otherwise exported the symbol. Consider the
133 ** following example:
134 **
135 ** class PEGASUS_COMMON_LINKAGE MyClass
136 ** {
137 ** public:
|
138 kumpf 1.65 **
|
139 mike 1.62 ** // Is exported (due to PEGASUS_COMMON_LINKAGE macro).
140 ** void f();
141 **
142 ** // Is not exported (despite the PEGASUS_COMMON_LINKAGE macro).
143 ** PEGASUS_HIDDEN_LINKAGE void g(); // not-exported.
144 ** };
145 **
146 ** Notes: this macro has an empty expansion on many platforms since this
147 ** feature is compiler specific.
148 **
149 **==============================================================================
150 */
151 #ifndef PEGASUS_HIDDEN_LINKAGE
152 # define PEGASUS_HIDDEN_LINKAGE /* empty */
|
153 kumpf 1.32 #endif
|
154 mike 1.22
|
155 mike 1.18 #ifdef PEGASUS_HAVE_NAMESPACES
|
156 ks.madhusudan 1.71 #ifdef __cplusplus
|
157 mike 1.18 # define PEGASUS_NAMESPACE_BEGIN namespace Pegasus {
158 # define PEGASUS_NAMESPACE_END }
|
159 vijay.eli 1.57 # define PEGASUS_NAMESPACE(X) Pegasus::X
|
160 mike 1.22
161 #ifndef PEGASUS_HAVE_NO_STD
|
162 mike 1.18 # define PEGASUS_STD(X) std::X
163 # define PEGASUS_USING_STD using namespace std
|
164 mike 1.22 #else
165 # define PEGASUS_STD(X) X
166 # define PEGASUS_USING_STD
167 #endif
|
168 mike 1.18 # define PEGASUS_USING_PEGASUS using namespace Pegasus
169 #else
170 # define PEGASUS_NAMESPACE_BEGIN /* empty */
171 # define PEGASUS_NAMESPACE_END /* empty */
|
172 vijay.eli 1.57 # define PEGASUS_NAMESPACE(X) X
|
173 mike 1.18 # define PEGASUS_STD(X) X
174 # define PEGASUS_USING_STD
175 # define PEGASUS_USING_PEGASUS
176 #endif
|
177 ks.madhusudan 1.71 #else
178 # define PEGASUS_NAMESPACE_BEGIN /* empty */
179 # define PEGASUS_NAMESPACE_END /* empty */
180 # define PEGASUS_NAMESPACE(X) X
181 # define PEGASUS_STD(X) X
182 # define PEGASUS_USING_STD
183 # define PEGASUS_USING_PEGASUS
184 #endif
185
186 #ifdef PEGASUS_HAVE_EXPLICIT
187 #ifdef __cplusplus
188 # define PEGASUS_EXPLICIT explicit
189 #else
190 # define PEGASUS_EXPLICIT /* empty */
191 #endif
192 #else
193 # define PEGASUS_EXPLICIT /* empty */
194 #endif
195
196 #ifdef PEGASUS_HAVE_MUTABLE
197 #ifdef __cplusplus
198 ks.madhusudan 1.71 # define PEGASUS_MUTABLE mutable
199 #else
200 # define PEGASUS_MUTABLE /* empty */
201 #endif
202 #else
203 # define PEGASUS_MUTABLE /* empty */
204 #endif
|
205 mike 1.18
206 #ifndef PEGASUS_HAVE_FOR_SCOPE
207 # define for if (0) ; else for
208 #endif
209
210 #ifdef PEGASUS_HAVE_TEMPLATE_SPECIALIZATION
|
211 ks.madhusudan 1.71 #ifdef __cplusplus
|
212 mike 1.18 # define PEGASUS_TEMPLATE_SPECIALIZATION template <>
213 #else
214 # define PEGASUS_TEMPLATE_SPECIALIZATION
|
215 karl 1.24 #endif
|
216 ks.madhusudan 1.71 #else
217 # define PEGASUS_TEMPLATE_SPECIALIZATION
218 #endif
|
219 karl 1.24
|
220 kumpf 1.32 #ifdef PEGASUS_HAVE_IOS_BINARY
|
221 ks.madhusudan 1.71 #ifdef __cplusplus
|
222 kumpf 1.32 #define PEGASUS_IOS_BINARY ,std::ios::binary
223 #define PEGASUS_OR_IOS_BINARY | std::ios::binary
224 #else
225 #define PEGASUS_IOS_BINARY /* empty */
226 #define PEGASUS_OR_IOS_BINARY /* empty */
227 #endif
|
228 ks.madhusudan 1.71 #else
229 #define PEGASUS_IOS_BINARY /* empty */
230 #define PEGASUS_OR_IOS_BINARY /* empty */
231 #endif
|
232 kumpf 1.32
|
233 kumpf 1.34 #ifndef PEGASUS_SINT64_LITERAL
|
234 kumpf 1.37 #define PEGASUS_SINT64_LITERAL(X) (Sint64 (X##LL))
|
235 kumpf 1.34 #endif
236 #ifndef PEGASUS_UINT64_LITERAL
|
237 kumpf 1.37 #define PEGASUS_UINT64_LITERAL(X) (Uint64 (X##ULL))
|
238 kumpf 1.34 #endif
|
239 mike 1.18
|
240 kumpf 1.69 /* Used in printf and scanf conversion strings for Uint64 and Sint64 args */
|
241 kumpf 1.40 #ifndef PEGASUS_64BIT_CONVERSION_WIDTH
242 #define PEGASUS_64BIT_CONVERSION_WIDTH "ll"
243 #endif
|
244 kumpf 1.46
245 #ifndef PEGASUS_MAXHOSTNAMELEN
|
246 denise.eckstein 1.66 # ifdef _POSIX_HOST_NAME_MAX
247 # define PEGASUS_MAXHOSTNAMELEN _POSIX_HOST_NAME_MAX
248 # else
249 # define PEGASUS_MAXHOSTNAMELEN MAXHOSTNAMELEN
250 # endif
|
251 kumpf 1.46 #endif
252
|
253 david.dillard 1.56 #ifdef __cplusplus
|
254 mike 1.18 PEGASUS_NAMESPACE_BEGIN
255
|
256 kumpf 1.35 typedef bool Boolean; // If platform w/o bool, add flag and include Boolean.h
|
257 mike 1.18 typedef unsigned char Uint8;
|
258 david.dillard 1.52 typedef signed char Sint8;
|
259 mike 1.18 typedef unsigned short Uint16;
|
260 david.dillard 1.52 typedef signed short Sint16;
|
261 mike 1.18 typedef unsigned int Uint32;
|
262 david.dillard 1.52 typedef signed int Sint32;
|
263 mike 1.18 typedef float Real32;
264 typedef double Real64;
265 typedef PEGASUS_UINT64 Uint64;
266 typedef PEGASUS_SINT64 Sint64;
267
268 #define PEG_NOT_FOUND Uint32(-1)
269
270 PEGASUS_NAMESPACE_END
|
271 david.dillard 1.56 #endif
|
272 mike 1.18
|
273 mike 1.20 #ifdef PEGASUS_SUPPRESS_UNREACHABLE_STATEMENTS
274 # define PEGASUS_UNREACHABLE(CODE)
275 #else
276 # define PEGASUS_UNREACHABLE(CODE) CODE
277 #endif
278
|
279 marek 1.74 /*
280 **==============================================================================
281 **
282 ** PEGASUS_FORMAT
283 **
284 ** This macro allows the compiler to check the arguments to format
285 ** specifiers in the printf family of functions. For example, the following
286 ** enables format checking for the foo function.
287 **
288 ** PEGASUS_FORMAT(1, 2)
289 ** void foo(const char* format, ...);
290 **
291 ** On GCC, the following error is detected below (when using this macro).
292 **
293 ** foo("%s %d", 99, "hello"); // mismatch specifiers!
294 **
295 **==============================================================================
296 */
297
298 #if defined(__GNUC__) && (__GNUC__ >= 4)
299 # define PEGASUS_FORMAT(A1, A2) __attribute__((format (printf, A1, A2)))
300 marek 1.74 #else
301 # define PEGASUS_FORMAT(A1, A2) /* not implemented */
302 #endif
303
304
|
305 mike 1.18 #endif /* Pegasus_Config_h */
|