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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2