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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2