1 martin 1.80 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.81 //
|
3 martin 1.80 // Licensed to The Open Group (TOG) under one or more contributor license
4 // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
5 // this work for additional information regarding copyright ownership.
6 // Each contributor licenses this file to you under the OpenPegasus Open
7 // Source License; you may not use this file except in compliance with the
8 // License.
|
9 martin 1.81 //
|
10 martin 1.80 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal in the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
|
16 martin 1.81 //
|
17 martin 1.80 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.81 //
|
20 martin 1.80 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.81 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.80 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
27 martin 1.81 //
|
28 martin 1.80 //////////////////////////////////////////////////////////////////////////
|
29 kumpf 1.69 /*
|
30 mike 1.18 //
31 //%/////////////////////////////////////////////////////////////////////////////
|
32 kumpf 1.69 */
|
33 mike 1.18
34 #ifndef Pegasus_Config_h
35 #define Pegasus_Config_h
36
37 #if defined(PEGASUS_PLATFORM_WIN32_IX86_MSVC)
38 # include <Pegasus/Common/Platform_WIN32_IX86_MSVC.h>
|
39 a.dunfey 1.68 #elif defined(PEGASUS_PLATFORM_WIN64_IA64_MSVC)
40 # include <Pegasus/Common/Platform_WIN64_IA64_MSVC.h>
41 #elif defined(PEGASUS_PLATFORM_WIN64_X86_64_MSVC)
42 # include <Pegasus/Common/Platform_WIN64_X86_64_MSVC.h>
|
43 mike 1.18 #elif defined (PEGASUS_PLATFORM_LINUX_IX86_GNU)
44 # include <Pegasus/Common/Platform_LINUX_IX86_GNU.h>
|
45 jim.wunderlich 1.59 #elif defined (PEGASUS_PLATFORM_LINUX_XSCALE_GNU)
46 # include <Pegasus/Common/Platform_LINUX_XSCALE_GNU.h>
|
47 ouyang.jian 1.75 #elif defined (PEGASUS_PLATFORM_PASE_ISERIES_IBMCXX)
48 #include <Pegasus/Common/Platform_PASE_ISERIES_IBMCXX.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 karl 1.77 #elif defined (PEGASUS_PLATFORM_SOLARIS_SPARC_64_CC)
62 # include <Pegasus/Common/Platform_SOLARIS_SPARC_CC_64.h>
63 #elif defined (PEGASUS_PLATFORM_SOLARIS_IX86_CC)
64 # include <Pegasus/Common/Platform_SOLARIS_IX86_CC.h>
65 #elif defined (PEGASUS_PLATFORM_SOLARIS_X86_64_CC)
66 # include <Pegasus/Common/Platform_SOLARIS_X86_64_CC.h>
|
67 mike 1.22 #elif defined (PEGASUS_PLATFORM_ZOS_ZSERIES_IBM)
68 # include <Pegasus/Common/Platform_ZOS_ZSERIES_IBM.h>
|
69 r.kieninger 1.78 #elif defined (PEGASUS_PLATFORM_ZOS_ZSERIES64_IBM)
70 # include <Pegasus/Common/Platform_ZOS_ZSERIES64_IBM.h>
|
71 kumpf 1.27 #elif defined (PEGASUS_PLATFORM_LINUX_IA64_GNU)
72 # include <Pegasus/Common/Platform_LINUX_IA64_GNU.h>
|
73 w.otsuka 1.58 #elif defined (PEGASUS_PLATFORM_LINUX_X86_64_GNU)
74 # include <Pegasus/Common/Platform_LINUX_X86_64_GNU.h>
|
75 david.eger 1.41 #elif defined (PEGASUS_PLATFORM_LINUX_PPC_GNU)
76 # include <Pegasus/Common/Platform_LINUX_PPC_GNU.h>
|
77 jenny.yu 1.55 #elif defined (PEGASUS_PLATFORM_LINUX_PPC64_GNU)
78 # include <Pegasus/Common/Platform_LINUX_PPC64_GNU.h>
|
79 david.eger 1.42 #elif defined (PEGASUS_PLATFORM_LINUX_ZSERIES_GNU)
80 # include <Pegasus/Common/Platform_LINUX_ZSERIES_GNU.h>
|
81 jenny.yu 1.55 #elif defined (PEGASUS_PLATFORM_LINUX_ZSERIES64_GNU)
82 # include <Pegasus/Common/Platform_LINUX_ZSERIES64_GNU.h>
|
83 dudhe.girish 1.47 #elif defined (PEGASUS_PLATFORM_DARWIN_PPC_GNU)
84 # include <Pegasus/Common/Platform_DARWIN_PPC_GNU.h>
|
85 mike 1.67 #elif defined (PEGASUS_PLATFORM_DARWIN_IX86_GNU)
86 # include <Pegasus/Common/Platform_DARWIN_IX86_GNU.h>
|
87 gs.keenan 1.54 #elif defined (PEGASUS_PLATFORM_VMS_ALPHA_DECCXX)
88 # include <Pegasus/Common/Platform_VMS_ALPHA_DECCXX.h>
89 #elif defined (PEGASUS_PLATFORM_VMS_IA64_DECCXX)
90 # include <Pegasus/Common/Platform_VMS_IA64_DECCXX.h>
|
91 jim.wunderlich 1.59 #elif defined (PEGASUS_PLATFORM_LINUX_XSCALE_GNU)
92 # include <Pegasus/Common/Platform_LINUX_XSCALE_GNU.h>
|
93 mike 1.18 #else
94 # error "<Pegasus/Common/Config.h>: Unsupported Platform"
95 #endif
96
|
97 mday 1.39
98
|
99 kumpf 1.69 /*
|
100 mday 1.39 //<<< Sun Apr 6 19:28:00 2003 mdd >>>
101 //
102 // COMPILER Checks
103 //
104 // This is to allow a check for GCC > 3.2
105 // It needs to be the first thing we check because the next lines load
106 // further source files
|
107 kumpf 1.69 */
|
108 mday 1.39
109 #if defined(__GNUC__)
110 #define GCC_VERSION (__GNUC__ * 10000 \
111 + __GNUC_MINOR__ * 100 \
112 + __GNUC_PATCHLEVEL__)
113
|
114 kumpf 1.69 /*
|
115 mday 1.39 // To test for GCC > 3.2.0:
116 // #if GCC_VERSION > 30200
|
117 kumpf 1.69 */
|
118 mday 1.39
|
119 kumpf 1.65 #endif
|
120 mday 1.39
121
|
122 david.dillard 1.56 #ifdef __cplusplus
|
123 mike 1.22 #include <cstdlib>
|
124 david.dillard 1.56 #endif
|
125 mike 1.22
|
126 mike 1.62 #ifndef PEGASUS_IMPORT
127 # define PEGASUS_IMPORT /* empty */
128 #endif
129
|
130 kumpf 1.32 #ifndef PEGASUS_EXPORT
|
131 mike 1.62 # define PEGASUS_EXPORT /* empty */
132 #endif
133
134 /*
135 **==============================================================================
136 **
137 ** PEGASUS_HIDDEN_LINKAGE
138 **
139 ** This macro suppresses the export of a symbol in contexts in which the
140 ** default linkage would have otherwise exported the symbol. Consider the
141 ** following example:
142 **
143 ** class PEGASUS_COMMON_LINKAGE MyClass
144 ** {
145 ** public:
|
146 kumpf 1.65 **
|
147 mike 1.62 ** // Is exported (due to PEGASUS_COMMON_LINKAGE macro).
148 ** void f();
149 **
150 ** // Is not exported (despite the PEGASUS_COMMON_LINKAGE macro).
151 ** PEGASUS_HIDDEN_LINKAGE void g(); // not-exported.
152 ** };
153 **
154 ** Notes: this macro has an empty expansion on many platforms since this
155 ** feature is compiler specific.
156 **
157 **==============================================================================
158 */
159 #ifndef PEGASUS_HIDDEN_LINKAGE
160 # define PEGASUS_HIDDEN_LINKAGE /* empty */
|
161 kumpf 1.32 #endif
|
162 mike 1.22
|
163 mike 1.18 #ifdef PEGASUS_HAVE_NAMESPACES
|
164 ks.madhusudan 1.71 #ifdef __cplusplus
|
165 mike 1.18 # define PEGASUS_NAMESPACE_BEGIN namespace Pegasus {
166 # define PEGASUS_NAMESPACE_END }
|
167 vijay.eli 1.57 # define PEGASUS_NAMESPACE(X) Pegasus::X
|
168 mike 1.22
169 #ifndef PEGASUS_HAVE_NO_STD
|
170 mike 1.18 # define PEGASUS_STD(X) std::X
171 # define PEGASUS_USING_STD using namespace std
|
172 mike 1.22 #else
173 # define PEGASUS_STD(X) X
174 # define PEGASUS_USING_STD
175 #endif
|
176 mike 1.18 # define PEGASUS_USING_PEGASUS using namespace Pegasus
177 #else
178 # define PEGASUS_NAMESPACE_BEGIN /* empty */
179 # define PEGASUS_NAMESPACE_END /* empty */
|
180 vijay.eli 1.57 # define PEGASUS_NAMESPACE(X) X
|
181 mike 1.18 # define PEGASUS_STD(X) X
182 # define PEGASUS_USING_STD
183 # define PEGASUS_USING_PEGASUS
184 #endif
|
185 ks.madhusudan 1.71 #else
186 # define PEGASUS_NAMESPACE_BEGIN /* empty */
187 # define PEGASUS_NAMESPACE_END /* empty */
188 # define PEGASUS_NAMESPACE(X) X
189 # define PEGASUS_STD(X) X
190 # define PEGASUS_USING_STD
191 # define PEGASUS_USING_PEGASUS
192 #endif
193
194 #ifdef PEGASUS_HAVE_EXPLICIT
195 #ifdef __cplusplus
196 # define PEGASUS_EXPLICIT explicit
197 #else
198 # define PEGASUS_EXPLICIT /* empty */
199 #endif
200 #else
201 # define PEGASUS_EXPLICIT /* empty */
202 #endif
203
|
204 mike 1.18 #ifndef PEGASUS_HAVE_FOR_SCOPE
205 # define for if (0) ; else for
206 #endif
207
208 #ifdef PEGASUS_HAVE_TEMPLATE_SPECIALIZATION
|
209 ks.madhusudan 1.71 #ifdef __cplusplus
|
210 mike 1.18 # define PEGASUS_TEMPLATE_SPECIALIZATION template <>
211 #else
212 # define PEGASUS_TEMPLATE_SPECIALIZATION
|
213 karl 1.24 #endif
|
214 ks.madhusudan 1.71 #else
215 # define PEGASUS_TEMPLATE_SPECIALIZATION
216 #endif
|
217 karl 1.24
|
218 kumpf 1.32 #ifdef PEGASUS_HAVE_IOS_BINARY
|
219 ks.madhusudan 1.71 #ifdef __cplusplus
|
220 kumpf 1.32 #define PEGASUS_IOS_BINARY ,std::ios::binary
221 #define PEGASUS_OR_IOS_BINARY | std::ios::binary
222 #else
223 #define PEGASUS_IOS_BINARY /* empty */
224 #define PEGASUS_OR_IOS_BINARY /* empty */
225 #endif
|
226 ks.madhusudan 1.71 #else
227 #define PEGASUS_IOS_BINARY /* empty */
228 #define PEGASUS_OR_IOS_BINARY /* empty */
229 #endif
|
230 kumpf 1.32
|
231 kumpf 1.34 #ifndef PEGASUS_SINT64_LITERAL
|
232 kumpf 1.37 #define PEGASUS_SINT64_LITERAL(X) (Sint64 (X##LL))
|
233 kumpf 1.34 #endif
234 #ifndef PEGASUS_UINT64_LITERAL
|
235 kumpf 1.37 #define PEGASUS_UINT64_LITERAL(X) (Uint64 (X##ULL))
|
236 kumpf 1.34 #endif
|
237 mike 1.18
|
238 kumpf 1.69 /* Used in printf and scanf conversion strings for Uint64 and Sint64 args */
|
239 kumpf 1.40 #ifndef PEGASUS_64BIT_CONVERSION_WIDTH
240 #define PEGASUS_64BIT_CONVERSION_WIDTH "ll"
241 #endif
|
242 kumpf 1.46
243 #ifndef PEGASUS_MAXHOSTNAMELEN
|
244 denise.eckstein 1.66 # ifdef _POSIX_HOST_NAME_MAX
245 # define PEGASUS_MAXHOSTNAMELEN _POSIX_HOST_NAME_MAX
246 # else
247 # define PEGASUS_MAXHOSTNAMELEN MAXHOSTNAMELEN
248 # endif
|
249 kumpf 1.46 #endif
250
|
251 david.dillard 1.56 #ifdef __cplusplus
|
252 mike 1.18 PEGASUS_NAMESPACE_BEGIN
253
|
254 kumpf 1.76 typedef bool Boolean;
|
255 mike 1.18 typedef unsigned char Uint8;
|
256 david.dillard 1.52 typedef signed char Sint8;
|
257 mike 1.18 typedef unsigned short Uint16;
|
258 david.dillard 1.52 typedef signed short Sint16;
|
259 mike 1.18 typedef unsigned int Uint32;
|
260 david.dillard 1.52 typedef signed int Sint32;
|
261 mike 1.18 typedef float Real32;
262 typedef double Real64;
263 typedef PEGASUS_UINT64 Uint64;
264 typedef PEGASUS_SINT64 Sint64;
265
266 #define PEG_NOT_FOUND Uint32(-1)
267
268 PEGASUS_NAMESPACE_END
|
269 david.dillard 1.56 #endif
|
270 mike 1.18
|
271 mike 1.20 #ifdef PEGASUS_SUPPRESS_UNREACHABLE_STATEMENTS
272 # define PEGASUS_UNREACHABLE(CODE)
273 #else
274 # define PEGASUS_UNREACHABLE(CODE) CODE
275 #endif
276
|
277 marek 1.74 /*
278 **==============================================================================
279 **
280 ** PEGASUS_FORMAT
281 **
282 ** This macro allows the compiler to check the arguments to format
283 ** specifiers in the printf family of functions. For example, the following
284 ** enables format checking for the foo function.
285 **
286 ** PEGASUS_FORMAT(1, 2)
287 ** void foo(const char* format, ...);
288 **
289 ** On GCC, the following error is detected below (when using this macro).
290 **
291 ** foo("%s %d", 99, "hello"); // mismatch specifiers!
292 **
293 **==============================================================================
294 */
295
296 #if defined(__GNUC__) && (__GNUC__ >= 4)
297 # define PEGASUS_FORMAT(A1, A2) __attribute__((format (printf, A1, A2)))
298 marek 1.74 #else
299 # define PEGASUS_FORMAT(A1, A2) /* not implemented */
300 #endif
301
|
302 marek 1.82 /*
303 ** PEGASUS_INITIAL_THREADSTACK_SIZE
304 **
305 ** This macro is used to restrict the maximal stack size used per thread.
306 ** Since OpenPegasus makes heavy use of multi-threading reducing the system
307 ** default is espescially important on embedded systems.
308 **
309 ** This value can be overridden platform specific by defining the macro in
310 ** the corresponding PEGASUS_PLATFORM_*.h file.
311 */
312 #ifndef PEGASUS_INITIAL_THREADSTACK_SIZE
313 # define PEGASUS_INITIAL_THREADSTACK_SIZE 256*1024
314 #endif
|
315 marek 1.74
|
316 thilo.boehm 1.82.4.1 /*
317 ** PEGASUS_PG_OBJECTMANAGER_ELEMENTNAME
318 **
319 ** This macro is used to set ElementName property on the PG_ObjectManager
320 ** instance. This value is also used in SLP announcment for service-hi-name.
321 **
322 ** This value can be overridden platform specific by defining the macro in
323 ** the corresponding PEGASUS_PLATFORM_*.h file.
324 */
325
326
327 #ifndef PEGASUS_PG_OBJECTMANAGER_ELEMENTNAME
328 # ifdef PEGASUS_FLAVOR
329 # define PEGASUS_PG_OBJECTMANAGER_ELEMENTNAME PEGASUS_FLAVOR"-pegasus"
330 # else
331 # define PEGASUS_PG_OBJECTMANAGER_ELEMENTNAME "Pegasus"
332 # endif
333 #endif
334
335
|
336 mike 1.18 #endif /* Pegasus_Config_h */
|