• Main Page
  • Classes
  • Files
  • File List

/var/tmp/axbld-24884/rpm/BUILD/pegasus/src/Pegasus/Common/Config.h

00001 //%LICENSE////////////////////////////////////////////////////////////////
00002 //
00003 // Licensed to The Open Group (TOG) under one or more contributor license
00004 // agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
00005 // this work for additional information regarding copyright ownership.
00006 // Each contributor licenses this file to you under the OpenPegasus Open
00007 // Source License; you may not use this file except in compliance with the
00008 // License.
00009 //
00010 // Permission is hereby granted, free of charge, to any person obtaining a
00011 // copy of this software and associated documentation files (the "Software"),
00012 // to deal in the Software without restriction, including without limitation
00013 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
00014 // and/or sell copies of the Software, and to permit persons to whom the
00015 // Software is furnished to do so, subject to the following conditions:
00016 //
00017 // The above copyright notice and this permission notice shall be included
00018 // in all copies or substantial portions of the Software.
00019 //
00020 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00021 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00022 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
00023 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
00024 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
00025 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
00026 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00027 //
00029 /*
00030 //
00031 //%/////////////////////////////////////////////////////////////////////////////
00032 */
00033 
00034 #ifndef Pegasus_Config_h
00035 #define Pegasus_Config_h
00036 
00037 #if defined(PEGASUS_PLATFORM_WIN32_IX86_MSVC)
00038 # include <Pegasus/Common/Platform_WIN32_IX86_MSVC.h>
00039 #elif defined(PEGASUS_PLATFORM_WIN64_IA64_MSVC)
00040 # include <Pegasus/Common/Platform_WIN64_IA64_MSVC.h>
00041 #elif defined(PEGASUS_PLATFORM_WIN64_X86_64_MSVC)
00042 # include <Pegasus/Common/Platform_WIN64_X86_64_MSVC.h>
00043 #elif defined (PEGASUS_PLATFORM_LINUX_IX86_GNU)
00044 # include <Pegasus/Common/Platform_LINUX_IX86_GNU.h>
00045 #elif defined (PEGASUS_PLATFORM_LINUX_XSCALE_GNU)
00046 # include <Pegasus/Common/Platform_LINUX_XSCALE_GNU.h>
00047 #elif defined (PEGASUS_PLATFORM_PASE_ISERIES_IBMCXX)
00048 #include <Pegasus/Common/Platform_PASE_ISERIES_IBMCXX.h>
00049 #elif defined (PEGASUS_PLATFORM_AIX_RS_IBMCXX)
00050 # include <Pegasus/Common/Platform_AIX_RS_IBMCXX.h>
00051 #elif defined (PEGASUS_PLATFORM_HPUX_PARISC_ACC)
00052 # include <Pegasus/Common/Platform_HPUX_PARISC_ACC.h>
00053 #elif defined (PEGASUS_PLATFORM_HPUX_PARISC_GNU)
00054 # include <Pegasus/Common/Platform_HPUX_PARISC_GNU.h>
00055 #elif defined (PEGASUS_PLATFORM_HPUX_IA64_ACC)
00056 # include <Pegasus/Common/Platform_HPUX_IA64_ACC.h>
00057 #elif defined (PEGASUS_PLATFORM_HPUX_IA64_GNU)
00058 # include <Pegasus/Common/Platform_HPUX_IA64_GNU.h>
00059 #elif defined (PEGASUS_PLATFORM_TRU64_ALPHA_DECCXX)
00060 # include <Pegasus/Common/Platform_TRU64_ALPHA_DECCXX.h>
00061 #elif defined (PEGASUS_PLATFORM_SOLARIS_SPARC_GNU)
00062 # include <Pegasus/Common/Platform_SOLARIS_SPARC_GNU.h>
00063 #elif defined (PEGASUS_PLATFORM_SOLARIS_SPARC_CC)
00064 # include <Pegasus/Common/Platform_SOLARIS_SPARC_CC.h>
00065 #elif defined (PEGASUS_PLATFORM_SOLARIS_SPARC_64_CC)
00066 # include <Pegasus/Common/Platform_SOLARIS_SPARC_CC_64.h>
00067 #elif defined (PEGASUS_PLATFORM_SOLARIS_IX86_CC)
00068 # include <Pegasus/Common/Platform_SOLARIS_IX86_CC.h>
00069 #elif defined (PEGASUS_PLATFORM_SOLARIS_X86_64_CC)
00070 # include <Pegasus/Common/Platform_SOLARIS_X86_64_CC.h>
00071 #elif defined (PEGASUS_PLATFORM_ZOS_ZSERIES_IBM)
00072 # include <Pegasus/Common/Platform_ZOS_ZSERIES_IBM.h>
00073 #elif defined (PEGASUS_PLATFORM_ZOS_ZSERIES64_IBM)
00074 # include <Pegasus/Common/Platform_ZOS_ZSERIES64_IBM.h>
00075 #elif defined (PEGASUS_PLATFORM_LINUX_IA64_GNU)
00076 # include <Pegasus/Common/Platform_LINUX_IA64_GNU.h>
00077 #elif defined (PEGASUS_PLATFORM_LINUX_X86_64_GNU)
00078 # include <Pegasus/Common/Platform_LINUX_X86_64_GNU.h>
00079 #elif defined (PEGASUS_PLATFORM_LINUX_PPC_GNU)
00080 # include <Pegasus/Common/Platform_LINUX_PPC_GNU.h>
00081 #elif defined (PEGASUS_PLATFORM_LINUX_PPC64_GNU)
00082 # include <Pegasus/Common/Platform_LINUX_PPC64_GNU.h>
00083 #elif defined (PEGASUS_PLATFORM_LINUX_PPC_E500_GNU)
00084 # include <Pegasus/Common/Platform_LINUX_PPC_E500_GNU.h>
00085 #elif defined (PEGASUS_PLATFORM_LINUX_SPARCV9_GNU)
00086 # include <Pegasus/Common/Platform_LINUX_SPARCV9_GNU.h>
00087 #elif defined (PEGASUS_PLATFORM_LINUX_SPARC64_GNU)
00088 # include <Pegasus/Common/Platform_LINUX_SPARC64_GNU.h>
00089 #elif defined (PEGASUS_PLATFORM_LINUX_ZSERIES_GNU)
00090 # include <Pegasus/Common/Platform_LINUX_ZSERIES_GNU.h>
00091 #elif defined (PEGASUS_PLATFORM_LINUX_ZSERIES64_GNU)
00092 # include <Pegasus/Common/Platform_LINUX_ZSERIES64_GNU.h>
00093 #elif defined (PEGASUS_PLATFORM_DARWIN_PPC_GNU)
00094 # include <Pegasus/Common/Platform_DARWIN_PPC_GNU.h>
00095 #elif defined (PEGASUS_PLATFORM_DARWIN_IX86_GNU)
00096 # include <Pegasus/Common/Platform_DARWIN_IX86_GNU.h>
00097 #elif defined (PEGASUS_PLATFORM_VMS_ALPHA_DECCXX)
00098 # include <Pegasus/Common/Platform_VMS_ALPHA_DECCXX.h>
00099 #elif defined (PEGASUS_PLATFORM_VMS_IA64_DECCXX)
00100 # include <Pegasus/Common/Platform_VMS_IA64_DECCXX.h>
00101 #elif defined (PEGASUS_PLATFORM_LINUX_XSCALE_GNU)
00102 # include <Pegasus/Common/Platform_LINUX_XSCALE_GNU.h>
00103 #elif defined (PEGASUS_PLATFORM_LINUX_X86_64_CLANG)
00104 # include <Pegasus/Common/Platform_LINUX_X86_64_CLANG.h>
00105 #elif defined (PEGASUS_PLATFORM_LINUX_IX86_CLANG)
00106 # include <Pegasus/Common/Platform_LINUX_IX86_CLANG.h>
00107 #else
00108 # error "<Pegasus/Common/Config.h>: Unsupported Platform"
00109 #endif
00110 
00111 
00112 
00113 /*
00114 //<<< Sun Apr  6 19:28:00 2003 mdd >>>
00115 //
00116 // COMPILER Checks
00117 //
00118 // This is to allow a check for GCC > 3.2
00119 // It needs to be the first thing we check because the next lines load
00120 // further source files
00121 */
00122 
00123 #if defined(__GNUC__)
00124 #define GCC_VERSION (__GNUC__ * 10000 \
00125                                + __GNUC_MINOR__ * 100 \
00126                                + __GNUC_PATCHLEVEL__)
00127 
00128 /*
00129 // To test for GCC > 3.2.0:
00130 //     #if GCC_VERSION > 30200
00131 */
00132 
00133 #endif
00134 
00135 
00136 #ifdef __cplusplus
00137 #include <cstdlib>
00138 #endif
00139 
00140 #ifndef PEGASUS_IMPORT
00141 # define PEGASUS_IMPORT /* empty */
00142 #endif
00143 
00144 #ifndef PEGASUS_EXPORT
00145 # define PEGASUS_EXPORT /* empty */
00146 #endif
00147 
00148 /*
00149 **==============================================================================
00150 **
00151 ** PEGASUS_HIDDEN_LINKAGE
00152 **
00153 **     This macro suppresses the export of a symbol in contexts in which the
00154 **     default linkage would have otherwise exported the symbol. Consider the
00155 **     following example:
00156 **
00157 **         class PEGASUS_COMMON_LINKAGE MyClass
00158 **         {
00159 **         public:
00160 **
00161 **             // Is exported (due to PEGASUS_COMMON_LINKAGE macro).
00162 **             void f();
00163 **
00164 **             // Is not exported (despite the PEGASUS_COMMON_LINKAGE macro).
00165 **             PEGASUS_HIDDEN_LINKAGE void g(); // not-exported.
00166 **         };
00167 **
00168 **     Notes: this macro has an empty expansion on many platforms since this
00169 **     feature is compiler specific.
00170 **
00171 **==============================================================================
00172 */
00173 #ifndef PEGASUS_HIDDEN_LINKAGE
00174 # define PEGASUS_HIDDEN_LINKAGE /* empty */
00175 #endif
00176 
00177 #ifdef PEGASUS_HAVE_NAMESPACES
00178 #ifdef __cplusplus
00179 # define PEGASUS_NAMESPACE_BEGIN namespace Pegasus {
00180 # define PEGASUS_NAMESPACE_END }
00181 # define PEGASUS_NAMESPACE(X) Pegasus::X
00182 
00183 #ifndef PEGASUS_HAVE_NO_STD
00184 # define PEGASUS_STD(X) std::X
00185 # define PEGASUS_USING_STD using namespace std
00186 #else
00187 # define PEGASUS_STD(X) X
00188 # define PEGASUS_USING_STD
00189 #endif
00190 # define PEGASUS_USING_PEGASUS using namespace Pegasus
00191 #else
00192 # define PEGASUS_NAMESPACE_BEGIN /* empty */
00193 # define PEGASUS_NAMESPACE_END /* empty */
00194 # define PEGASUS_NAMESPACE(X) X
00195 # define PEGASUS_STD(X) X
00196 # define PEGASUS_USING_STD
00197 # define PEGASUS_USING_PEGASUS
00198 #endif
00199 #else
00200 # define PEGASUS_NAMESPACE_BEGIN /* empty */
00201 # define PEGASUS_NAMESPACE_END /* empty */
00202 # define PEGASUS_NAMESPACE(X) X
00203 # define PEGASUS_STD(X) X
00204 # define PEGASUS_USING_STD
00205 # define PEGASUS_USING_PEGASUS
00206 #endif
00207 
00208 #ifdef PEGASUS_HAVE_EXPLICIT
00209 #ifdef __cplusplus
00210 # define PEGASUS_EXPLICIT explicit
00211 #else
00212 # define PEGASUS_EXPLICIT /* empty */
00213 #endif
00214 #else
00215 # define PEGASUS_EXPLICIT /* empty */
00216 #endif
00217 
00218 #ifndef PEGASUS_HAVE_FOR_SCOPE
00219 # define for if (0) ; else for
00220 #endif
00221 
00222 #ifdef PEGASUS_HAVE_TEMPLATE_SPECIALIZATION
00223 #ifdef __cplusplus
00224 # define PEGASUS_TEMPLATE_SPECIALIZATION template <>
00225 #else
00226 # define PEGASUS_TEMPLATE_SPECIALIZATION
00227 #endif
00228 #else
00229 # define PEGASUS_TEMPLATE_SPECIALIZATION
00230 #endif
00231 
00232 #ifdef PEGASUS_HAVE_IOS_BINARY
00233 #ifdef __cplusplus
00234 #define PEGASUS_IOS_BINARY ,std::ios::binary
00235 #define PEGASUS_OR_IOS_BINARY | std::ios::binary
00236 #else
00237 #define PEGASUS_IOS_BINARY /* empty */
00238 #define PEGASUS_OR_IOS_BINARY /* empty */
00239 #endif
00240 #else
00241 #define PEGASUS_IOS_BINARY /* empty */
00242 #define PEGASUS_OR_IOS_BINARY /* empty */
00243 #endif
00244 
00245 #ifndef PEGASUS_SINT64_LITERAL
00246 #define PEGASUS_SINT64_LITERAL(X) (Sint64 (X##LL))
00247 #endif
00248 #ifndef PEGASUS_UINT64_LITERAL
00249 #define PEGASUS_UINT64_LITERAL(X) (Uint64 (X##ULL))
00250 #endif
00251 
00252 /* Used in printf and scanf conversion strings for Uint64 and Sint64 args */
00253 #ifndef PEGASUS_64BIT_CONVERSION_WIDTH
00254 #define PEGASUS_64BIT_CONVERSION_WIDTH "ll"
00255 #endif
00256 
00257 #ifndef PEGASUS_MAXHOSTNAMELEN
00258 # ifdef _POSIX_HOST_NAME_MAX
00259 #  define PEGASUS_MAXHOSTNAMELEN _POSIX_HOST_NAME_MAX
00260 # else
00261 #  define PEGASUS_MAXHOSTNAMELEN MAXHOSTNAMELEN
00262 # endif
00263 #endif
00264 
00265 #ifdef __cplusplus
00266 PEGASUS_NAMESPACE_BEGIN
00267 
00268 typedef bool Boolean;
00269 typedef unsigned char Uint8;
00270 typedef signed char Sint8;
00271 typedef unsigned short Uint16;
00272 typedef signed short Sint16;
00273 typedef unsigned int Uint32;
00274 typedef signed int Sint32;
00275 typedef float Real32;
00276 typedef double Real64;
00277 typedef PEGASUS_UINT64 Uint64;
00278 typedef PEGASUS_SINT64 Sint64;
00279 
00280 #define PEG_NOT_FOUND Uint32(-1)
00281 
00282 PEGASUS_NAMESPACE_END
00283 #endif
00284 
00285 #ifdef PEGASUS_SUPPRESS_UNREACHABLE_STATEMENTS
00286 # define PEGASUS_UNREACHABLE(CODE)
00287 #else
00288 # define PEGASUS_UNREACHABLE(CODE) CODE
00289 #endif
00290 
00291 /*
00292 **==============================================================================
00293 **
00294 ** PEGASUS_FORMAT
00295 **
00296 **     This macro allows the compiler to check the arguments to format
00297 **     specifiers in the printf family of functions. For example, the following
00298 **     enables format checking for the foo function.
00299 **
00300 **         PEGASUS_FORMAT(1, 2)
00301 **         void foo(const char* format, ...);
00302 **
00303 **     On GCC, the following error is detected  below (when using this macro).
00304 **
00305 **         foo("%s %d", 99, "hello"); // mismatch specifiers!
00306 **
00307 **==============================================================================
00308 */
00309 
00310 #if defined(__GNUC__) &&  (__GNUC__ >= 4)
00311 # define PEGASUS_FORMAT(A1, A2) __attribute__((format (printf, A1, A2)))
00312 #else
00313 # define PEGASUS_FORMAT(A1, A2) /* not implemented */
00314 #endif
00315 
00316 /* 
00317 ** PEGASUS_INITIAL_THREADSTACK_SIZE
00318 **
00319 ** This macro is used to restrict the maximal stack size used per thread.
00320 ** Since OpenPegasus makes heavy use of multi-threading reducing the system
00321 ** default is espescially important on embedded systems.
00322 **
00323 ** This value can be overridden platform specific by defining the macro in
00324 ** the corresponding PEGASUS_PLATFORM_*.h file.
00325 */
00326 #ifndef PEGASUS_INITIAL_THREADSTACK_SIZE
00327 # define PEGASUS_INITIAL_THREADSTACK_SIZE 256*1024
00328 #endif
00329 
00330 /*
00331 ** PEGASUS_PG_OBJECTMANAGER_ELEMENTNAME
00332 ** 
00333 ** This macro is used to set ElementName property on the PG_ObjectManager
00334 ** instance. This value is also used in SLP announcment for service-hi-name.
00335 **
00336 ** This value can be overridden platform specific by defining the macro in
00337 ** the corresponding PEGASUS_PLATFORM_*.h file.
00338 */
00339 #ifndef PEGASUS_PG_OBJECTMANAGER_ELEMENTNAME
00340 # ifdef PEGASUS_FLAVOR
00341 #  define PEGASUS_PG_OBJECTMANAGER_ELEMENTNAME PEGASUS_FLAVOR"-pegasus"
00342 # else
00343 #  define PEGASUS_PG_OBJECTMANAGER_ELEMENTNAME "Pegasus"
00344 # endif 
00345 #endif
00346 
00347 /*
00348 ** PEGASUS_INSTANCEID_GLOBAL_PREFIX
00349 ** This macro is used to create the Name property on the PG_ObjectManager
00350 ** instance. This value is also used in SLP announcement for service-id.
00351 **
00352 ** This value can be overridden platform specific by defining the macro in
00353 ** the corresponding PEGASUS_PLATFORM_*.h file.
00354 */
00355 #ifndef PEGASUS_INSTANCEID_GLOBAL_PREFIX
00356 # ifdef PEGASUS_FLAVOR
00357 #  define PEGASUS_INSTANCEID_GLOBAL_PREFIX "PG-"PEGASUS_FLAVOR
00358 # else
00359 #  define PEGASUS_INSTANCEID_GLOBAL_PREFIX "PG"
00360 # endif
00361 #endif
00362 
00363 #endif  /* Pegasus_Config_h */