(file) Return to Config.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

  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 nagaraj.gr     1.87 #elif defined (PEGASUS_PLATFORM_HPUX_PARISC_GNU)
 54                     # include <Pegasus/Common/Platform_HPUX_PARISC_GNU.h>
 55 kumpf          1.36 #elif defined (PEGASUS_PLATFORM_HPUX_IA64_ACC)
 56                     # include <Pegasus/Common/Platform_HPUX_IA64_ACC.h>
 57 nagaraj.gr     1.87 #elif defined (PEGASUS_PLATFORM_HPUX_IA64_GNU)
 58                     # include <Pegasus/Common/Platform_HPUX_IA64_GNU.h>
 59 mike           1.19 #elif defined (PEGASUS_PLATFORM_TRU64_ALPHA_DECCXX)
 60                     # include <Pegasus/Common/Platform_TRU64_ALPHA_DECCXX.h>
 61 mike           1.21 #elif defined (PEGASUS_PLATFORM_SOLARIS_SPARC_GNU)
 62                     # include <Pegasus/Common/Platform_SOLARIS_SPARC_GNU.h>
 63 keith.petley   1.43 #elif defined (PEGASUS_PLATFORM_SOLARIS_SPARC_CC)
 64                     # include <Pegasus/Common/Platform_SOLARIS_SPARC_CC.h>
 65 karl           1.77 #elif defined (PEGASUS_PLATFORM_SOLARIS_SPARC_64_CC)
 66                     # include <Pegasus/Common/Platform_SOLARIS_SPARC_CC_64.h>
 67                     #elif defined (PEGASUS_PLATFORM_SOLARIS_IX86_CC)
 68                     # include <Pegasus/Common/Platform_SOLARIS_IX86_CC.h>
 69                     #elif defined (PEGASUS_PLATFORM_SOLARIS_X86_64_CC)
 70                     # include <Pegasus/Common/Platform_SOLARIS_X86_64_CC.h>
 71 mike           1.22 #elif defined (PEGASUS_PLATFORM_ZOS_ZSERIES_IBM)
 72                     # include <Pegasus/Common/Platform_ZOS_ZSERIES_IBM.h>
 73 r.kieninger    1.78 #elif defined (PEGASUS_PLATFORM_ZOS_ZSERIES64_IBM)
 74                     # include <Pegasus/Common/Platform_ZOS_ZSERIES64_IBM.h>
 75 kumpf          1.27 #elif defined (PEGASUS_PLATFORM_LINUX_IA64_GNU)
 76                     # include <Pegasus/Common/Platform_LINUX_IA64_GNU.h>
 77 w.otsuka       1.58 #elif defined (PEGASUS_PLATFORM_LINUX_X86_64_GNU)
 78                     # include <Pegasus/Common/Platform_LINUX_X86_64_GNU.h>
 79 david.eger     1.41 #elif defined (PEGASUS_PLATFORM_LINUX_PPC_GNU)
 80                     # include <Pegasus/Common/Platform_LINUX_PPC_GNU.h>
 81 jenny.yu       1.55 #elif defined (PEGASUS_PLATFORM_LINUX_PPC64_GNU)
 82                     # include <Pegasus/Common/Platform_LINUX_PPC64_GNU.h>
 83 marek          1.84 #elif defined (PEGASUS_PLATFORM_LINUX_PPC_E500_GNU)
 84                     # include <Pegasus/Common/Platform_LINUX_PPC_E500_GNU.h>
 85 david.eger     1.42 #elif defined (PEGASUS_PLATFORM_LINUX_ZSERIES_GNU)
 86                     # include <Pegasus/Common/Platform_LINUX_ZSERIES_GNU.h>
 87 jenny.yu       1.55 #elif defined (PEGASUS_PLATFORM_LINUX_ZSERIES64_GNU)
 88                     # include <Pegasus/Common/Platform_LINUX_ZSERIES64_GNU.h>
 89 dudhe.girish   1.47 #elif defined (PEGASUS_PLATFORM_DARWIN_PPC_GNU)
 90                     # include <Pegasus/Common/Platform_DARWIN_PPC_GNU.h>
 91 mike           1.67 #elif defined (PEGASUS_PLATFORM_DARWIN_IX86_GNU)
 92                     # include <Pegasus/Common/Platform_DARWIN_IX86_GNU.h>
 93 gs.keenan      1.54 #elif defined (PEGASUS_PLATFORM_VMS_ALPHA_DECCXX)
 94                     # include <Pegasus/Common/Platform_VMS_ALPHA_DECCXX.h>
 95                     #elif defined (PEGASUS_PLATFORM_VMS_IA64_DECCXX)
 96                     # include <Pegasus/Common/Platform_VMS_IA64_DECCXX.h>
 97 jim.wunderlich 1.59 #elif defined (PEGASUS_PLATFORM_LINUX_XSCALE_GNU)
 98                     # include <Pegasus/Common/Platform_LINUX_XSCALE_GNU.h>
 99 dev.meetei     1.86 #elif defined (PEGASUS_PLATFORM_LINUX_X86_64_CLANG)
100                     # include <Pegasus/Common/Platform_LINUX_X86_64_CLANG.h>
101                     #elif defined (PEGASUS_PLATFORM_LINUX_IX86_CLANG)
102                     # include <Pegasus/Common/Platform_LINUX_IX86_CLANG.h>
103 mike           1.18 #else
104                     # error "<Pegasus/Common/Config.h>: Unsupported Platform"
105                     #endif
106                     
107 mday           1.39 
108                     
109 kumpf          1.69 /*
110 mday           1.39 //<<< Sun Apr  6 19:28:00 2003 mdd >>>
111                     //
112                     // COMPILER Checks
113                     //
114                     // This is to allow a check for GCC > 3.2
115                     // It needs to be the first thing we check because the next lines load
116                     // further source files
117 kumpf          1.69 */
118 mday           1.39 
119                     #if defined(__GNUC__)
120                     #define GCC_VERSION (__GNUC__ * 10000 \
121                                                    + __GNUC_MINOR__ * 100 \
122                                                    + __GNUC_PATCHLEVEL__)
123                     
124 kumpf          1.69 /*
125 mday           1.39 // To test for GCC > 3.2.0:
126                     //     #if GCC_VERSION > 30200
127 kumpf          1.69 */
128 mday           1.39 
129 kumpf          1.65 #endif
130 mday           1.39 
131                     
132 david.dillard  1.56 #ifdef __cplusplus
133 mike           1.22 #include <cstdlib>
134 david.dillard  1.56 #endif
135 mike           1.22 
136 mike           1.62 #ifndef PEGASUS_IMPORT
137                     # define PEGASUS_IMPORT /* empty */
138                     #endif
139                     
140 kumpf          1.32 #ifndef PEGASUS_EXPORT
141 mike           1.62 # define PEGASUS_EXPORT /* empty */
142                     #endif
143                     
144                     /*
145                     **==============================================================================
146                     **
147                     ** PEGASUS_HIDDEN_LINKAGE
148                     **
149                     **     This macro suppresses the export of a symbol in contexts in which the
150                     **     default linkage would have otherwise exported the symbol. Consider the
151                     **     following example:
152                     **
153                     **         class PEGASUS_COMMON_LINKAGE MyClass
154                     **         {
155                     **         public:
156 kumpf          1.65 **
157 mike           1.62 **             // Is exported (due to PEGASUS_COMMON_LINKAGE macro).
158                     **             void f();
159                     **
160                     **             // Is not exported (despite the PEGASUS_COMMON_LINKAGE macro).
161                     **             PEGASUS_HIDDEN_LINKAGE void g(); // not-exported.
162                     **         };
163                     **
164                     **     Notes: this macro has an empty expansion on many platforms since this
165                     **     feature is compiler specific.
166                     **
167                     **==============================================================================
168                     */
169                     #ifndef PEGASUS_HIDDEN_LINKAGE
170                     # define PEGASUS_HIDDEN_LINKAGE /* empty */
171 kumpf          1.32 #endif
172 mike           1.22 
173 mike           1.18 #ifdef PEGASUS_HAVE_NAMESPACES
174 ks.madhusudan  1.71 #ifdef __cplusplus
175 mike           1.18 # define PEGASUS_NAMESPACE_BEGIN namespace Pegasus {
176                     # define PEGASUS_NAMESPACE_END }
177 vijay.eli      1.57 # define PEGASUS_NAMESPACE(X) Pegasus::X
178 mike           1.22 
179                     #ifndef PEGASUS_HAVE_NO_STD
180 mike           1.18 # define PEGASUS_STD(X) std::X
181                     # define PEGASUS_USING_STD using namespace std
182 mike           1.22 #else
183                     # define PEGASUS_STD(X) X
184                     # define PEGASUS_USING_STD
185                     #endif
186 mike           1.18 # define PEGASUS_USING_PEGASUS using namespace Pegasus
187                     #else
188                     # define PEGASUS_NAMESPACE_BEGIN /* empty */
189                     # define PEGASUS_NAMESPACE_END /* empty */
190 vijay.eli      1.57 # define PEGASUS_NAMESPACE(X) X
191 mike           1.18 # define PEGASUS_STD(X) X
192                     # define PEGASUS_USING_STD
193                     # define PEGASUS_USING_PEGASUS
194                     #endif
195 ks.madhusudan  1.71 #else
196                     # define PEGASUS_NAMESPACE_BEGIN /* empty */
197                     # define PEGASUS_NAMESPACE_END /* empty */
198                     # define PEGASUS_NAMESPACE(X) X
199                     # define PEGASUS_STD(X) X
200                     # define PEGASUS_USING_STD
201                     # define PEGASUS_USING_PEGASUS
202                     #endif
203                     
204                     #ifdef PEGASUS_HAVE_EXPLICIT
205                     #ifdef __cplusplus
206                     # define PEGASUS_EXPLICIT explicit
207                     #else
208                     # define PEGASUS_EXPLICIT /* empty */
209                     #endif
210                     #else
211                     # define PEGASUS_EXPLICIT /* empty */
212                     #endif
213                     
214 mike           1.18 #ifndef PEGASUS_HAVE_FOR_SCOPE
215                     # define for if (0) ; else for
216                     #endif
217                     
218                     #ifdef PEGASUS_HAVE_TEMPLATE_SPECIALIZATION
219 ks.madhusudan  1.71 #ifdef __cplusplus
220 mike           1.18 # define PEGASUS_TEMPLATE_SPECIALIZATION template <>
221                     #else
222                     # define PEGASUS_TEMPLATE_SPECIALIZATION
223 karl           1.24 #endif
224 ks.madhusudan  1.71 #else
225                     # define PEGASUS_TEMPLATE_SPECIALIZATION
226                     #endif
227 karl           1.24 
228 kumpf          1.32 #ifdef PEGASUS_HAVE_IOS_BINARY
229 ks.madhusudan  1.71 #ifdef __cplusplus
230 kumpf          1.32 #define PEGASUS_IOS_BINARY ,std::ios::binary
231                     #define PEGASUS_OR_IOS_BINARY | std::ios::binary
232                     #else
233                     #define PEGASUS_IOS_BINARY /* empty */
234                     #define PEGASUS_OR_IOS_BINARY /* empty */
235                     #endif
236 ks.madhusudan  1.71 #else
237                     #define PEGASUS_IOS_BINARY /* empty */
238                     #define PEGASUS_OR_IOS_BINARY /* empty */
239                     #endif
240 kumpf          1.32 
241 kumpf          1.34 #ifndef PEGASUS_SINT64_LITERAL
242 kumpf          1.37 #define PEGASUS_SINT64_LITERAL(X) (Sint64 (X##LL))
243 kumpf          1.34 #endif
244                     #ifndef PEGASUS_UINT64_LITERAL
245 kumpf          1.37 #define PEGASUS_UINT64_LITERAL(X) (Uint64 (X##ULL))
246 kumpf          1.34 #endif
247 mike           1.18 
248 kumpf          1.69 /* Used in printf and scanf conversion strings for Uint64 and Sint64 args */
249 kumpf          1.40 #ifndef PEGASUS_64BIT_CONVERSION_WIDTH
250                     #define PEGASUS_64BIT_CONVERSION_WIDTH "ll"
251                     #endif
252 kumpf          1.46 
253                     #ifndef PEGASUS_MAXHOSTNAMELEN
254 denise.eckstein 1.66 # ifdef _POSIX_HOST_NAME_MAX
255                      #  define PEGASUS_MAXHOSTNAMELEN _POSIX_HOST_NAME_MAX
256                      # else
257                      #  define PEGASUS_MAXHOSTNAMELEN MAXHOSTNAMELEN
258                      # endif
259 kumpf           1.46 #endif
260                      
261 david.dillard   1.56 #ifdef __cplusplus
262 mike            1.18 PEGASUS_NAMESPACE_BEGIN
263                      
264 kumpf           1.76 typedef bool Boolean;
265 mike            1.18 typedef unsigned char Uint8;
266 david.dillard   1.52 typedef signed char Sint8;
267 mike            1.18 typedef unsigned short Uint16;
268 david.dillard   1.52 typedef signed short Sint16;
269 mike            1.18 typedef unsigned int Uint32;
270 david.dillard   1.52 typedef signed int Sint32;
271 mike            1.18 typedef float Real32;
272                      typedef double Real64;
273                      typedef PEGASUS_UINT64 Uint64;
274                      typedef PEGASUS_SINT64 Sint64;
275                      
276                      #define PEG_NOT_FOUND Uint32(-1)
277                      
278                      PEGASUS_NAMESPACE_END
279 david.dillard   1.56 #endif
280 mike            1.18 
281 dl.meetei       1.88 
282                      /*
283                       *PEGASUS_UNREACHABLE implies unreachable code in pegasus.
284                       *Should be used in places where the control should not reached.
285                       *Please use in this way
286                       * PEGASUS_UNREACHABLE( expression;)
287                       *not in this way
288                       * PEGASUS_UNREACHABLE(expression);
289                       *
290                       *Though both are same, Former will prevent ;;(double semicolon)
291                       *
292                       */
293                      
294 mike            1.20 #ifdef PEGASUS_SUPPRESS_UNREACHABLE_STATEMENTS
295                      # define PEGASUS_UNREACHABLE(CODE)
296                      #else
297 dl.meetei       1.88 # if defined(__clang__ )
298                      #  define PEGASUS_UNREACHABLE(CODE) __builtin_unreachable();
299                      # elif defined(GCC_VERSION)
300                      #  if GCC_VERSION >= 40500 //Unreachable supported only for gcc 4.5 and above
301                      #   define PEGASUS_UNREACHABLE(CODE) __builtin_unreachable();
302                      #  else
303                      #   define PEGASUS_UNREACHABLE(CODE) CODE
304                      #  endif
305                      # elif defined(_MSC_VER) //PEGASUS_OS_TYPE_WINDOWS
306                      #  define PEGASUS_UNREACHABLE(CODE) __assume(0);
307                      # else
308                      #  define PEGASUS_UNREACHABLE(CODE) CODE
309                      # endif
310 mike            1.20 #endif
311                      
312 marek           1.74 /*
313                      **==============================================================================
314                      **
315                      ** PEGASUS_FORMAT
316                      **
317                      **     This macro allows the compiler to check the arguments to format
318                      **     specifiers in the printf family of functions. For example, the following
319                      **     enables format checking for the foo function.
320                      **
321                      **         PEGASUS_FORMAT(1, 2)
322                      **         void foo(const char* format, ...);
323                      **
324                      **     On GCC, the following error is detected  below (when using this macro).
325                      **
326                      **         foo("%s %d", 99, "hello"); // mismatch specifiers!
327                      **
328                      **==============================================================================
329                      */
330                      
331                      #if defined(__GNUC__) &&  (__GNUC__ >= 4)
332                      # define PEGASUS_FORMAT(A1, A2) __attribute__((format (printf, A1, A2)))
333 marek           1.74 #else
334                      # define PEGASUS_FORMAT(A1, A2) /* not implemented */
335                      #endif
336                      
337 marek           1.82 /* 
338                      ** PEGASUS_INITIAL_THREADSTACK_SIZE
339                      **
340                      ** This macro is used to restrict the maximal stack size used per thread.
341                      ** Since OpenPegasus makes heavy use of multi-threading reducing the system
342                      ** default is espescially important on embedded systems.
343                      **
344                      ** This value can be overridden platform specific by defining the macro in
345                      ** the corresponding PEGASUS_PLATFORM_*.h file.
346                      */
347                      #ifndef PEGASUS_INITIAL_THREADSTACK_SIZE
348                      # define PEGASUS_INITIAL_THREADSTACK_SIZE 256*1024
349                      #endif
350 marek           1.74 
351 thilo.boehm     1.83 /*
352                      ** PEGASUS_PG_OBJECTMANAGER_ELEMENTNAME
353                      ** 
354                      ** This macro is used to set ElementName property on the PG_ObjectManager
355                      ** instance. This value is also used in SLP announcment for service-hi-name.
356                      **
357                      ** This value can be overridden platform specific by defining the macro in
358                      ** the corresponding PEGASUS_PLATFORM_*.h file.
359                      */
360                      #ifndef PEGASUS_PG_OBJECTMANAGER_ELEMENTNAME
361                      # ifdef PEGASUS_FLAVOR
362                      #  define PEGASUS_PG_OBJECTMANAGER_ELEMENTNAME PEGASUS_FLAVOR"-pegasus"
363                      # else
364                      #  define PEGASUS_PG_OBJECTMANAGER_ELEMENTNAME "Pegasus"
365                      # endif 
366                      #endif
367                      
368 thilo.boehm     1.85 /*
369                      ** PEGASUS_INSTANCEID_GLOBAL_PREFIX
370                      ** This macro is used to create the Name property on the PG_ObjectManager
371                      ** instance. This value is also used in SLP announcement for service-id.
372                      **
373                      ** This value can be overridden platform specific by defining the macro in
374                      ** the corresponding PEGASUS_PLATFORM_*.h file.
375                      */
376                      #ifndef PEGASUS_INSTANCEID_GLOBAL_PREFIX
377                      # ifdef PEGASUS_FLAVOR
378                      #  define PEGASUS_INSTANCEID_GLOBAL_PREFIX "PG-"PEGASUS_FLAVOR
379                      # else
380                      #  define PEGASUS_INSTANCEID_GLOBAL_PREFIX "PG"
381                      # endif
382                      #endif
383 thilo.boehm     1.83 
384 mike            1.18 #endif  /* Pegasus_Config_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2