/scratch/rpmbuild.5425.Bj5455/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_IA64_ACC)
00054 # include <Pegasus/Common/Platform_HPUX_IA64_ACC.h>
00055 #elif defined (PEGASUS_PLATFORM_TRU64_ALPHA_DECCXX)
00056 # include <Pegasus/Common/Platform_TRU64_ALPHA_DECCXX.h>
00057 #elif defined (PEGASUS_PLATFORM_SOLARIS_SPARC_GNU)
00058 # include <Pegasus/Common/Platform_SOLARIS_SPARC_GNU.h>
00059 #elif defined (PEGASUS_PLATFORM_SOLARIS_SPARC_CC)
00060 # include <Pegasus/Common/Platform_SOLARIS_SPARC_CC.h>
00061 #elif defined (PEGASUS_PLATFORM_SOLARIS_SPARC_64_CC)
00062 # include <Pegasus/Common/Platform_SOLARIS_SPARC_CC_64.h>
00063 #elif defined (PEGASUS_PLATFORM_SOLARIS_IX86_CC)
00064 # include <Pegasus/Common/Platform_SOLARIS_IX86_CC.h>
00065 #elif defined (PEGASUS_PLATFORM_SOLARIS_X86_64_CC)
00066 # include <Pegasus/Common/Platform_SOLARIS_X86_64_CC.h>
00067 #elif defined (PEGASUS_PLATFORM_ZOS_ZSERIES_IBM)
00068 # include <Pegasus/Common/Platform_ZOS_ZSERIES_IBM.h>
00069 #elif defined (PEGASUS_PLATFORM_ZOS_ZSERIES64_IBM)
00070 # include <Pegasus/Common/Platform_ZOS_ZSERIES64_IBM.h>
00071 #elif defined (PEGASUS_PLATFORM_LINUX_IA64_GNU)
00072 # include <Pegasus/Common/Platform_LINUX_IA64_GNU.h>
00073 #elif defined (PEGASUS_PLATFORM_LINUX_X86_64_GNU)
00074 # include <Pegasus/Common/Platform_LINUX_X86_64_GNU.h>
00075 #elif defined (PEGASUS_PLATFORM_LINUX_PPC_GNU)
00076 # include <Pegasus/Common/Platform_LINUX_PPC_GNU.h>
00077 #elif defined (PEGASUS_PLATFORM_LINUX_PPC64_GNU)
00078 # include <Pegasus/Common/Platform_LINUX_PPC64_GNU.h>
00079 #elif defined (PEGASUS_PLATFORM_LINUX_ZSERIES_GNU)
00080 # include <Pegasus/Common/Platform_LINUX_ZSERIES_GNU.h>
00081 #elif defined (PEGASUS_PLATFORM_LINUX_ZSERIES64_GNU)
00082 # include <Pegasus/Common/Platform_LINUX_ZSERIES64_GNU.h>
00083 #elif defined (PEGASUS_PLATFORM_DARWIN_PPC_GNU)
00084 # include <Pegasus/Common/Platform_DARWIN_PPC_GNU.h>
00085 #elif defined (PEGASUS_PLATFORM_DARWIN_IX86_GNU)
00086 # include <Pegasus/Common/Platform_DARWIN_IX86_GNU.h>
00087 #elif defined (PEGASUS_PLATFORM_VMS_ALPHA_DECCXX)
00088 # include <Pegasus/Common/Platform_VMS_ALPHA_DECCXX.h>
00089 #elif defined (PEGASUS_PLATFORM_VMS_IA64_DECCXX)
00090 # include <Pegasus/Common/Platform_VMS_IA64_DECCXX.h>
00091 #elif defined (PEGASUS_PLATFORM_LINUX_XSCALE_GNU)
00092 # include <Pegasus/Common/Platform_LINUX_XSCALE_GNU.h>
00093 #else
00094 # error "<Pegasus/Common/Config.h>: Unsupported Platform"
00095 #endif
00096 
00097 
00098 
00099 /*
00100 //<<< Sun Apr  6 19:28:00 2003 mdd >>>
00101 //
00102 // COMPILER Checks
00103 //
00104 // This is to allow a check for GCC > 3.2
00105 // It needs to be the first thing we check because the next lines load
00106 // further source files
00107 */
00108 
00109 #if defined(__GNUC__)
00110 #define GCC_VERSION (__GNUC__ * 10000 \
00111                                + __GNUC_MINOR__ * 100 \
00112                                + __GNUC_PATCHLEVEL__)
00113 
00114 /*
00115 // To test for GCC > 3.2.0:
00116 //     #if GCC_VERSION > 30200
00117 */
00118 
00119 #endif
00120 
00121 
00122 #ifdef __cplusplus
00123 #include <cstdlib>
00124 #endif
00125 
00126 #ifndef PEGASUS_IMPORT
00127 # define PEGASUS_IMPORT /* empty */
00128 #endif
00129 
00130 #ifndef PEGASUS_EXPORT
00131 # define PEGASUS_EXPORT /* empty */
00132 #endif
00133 
00134 /*
00135 **==============================================================================
00136 **
00137 ** PEGASUS_HIDDEN_LINKAGE
00138 **
00139 **     This macro suppresses the export of a symbol in contexts in which the
00140 **     default linkage would have otherwise exported the symbol. Consider the
00141 **     following example:
00142 **
00143 **         class PEGASUS_COMMON_LINKAGE MyClass
00144 **         {
00145 **         public:
00146 **
00147 **             // Is exported (due to PEGASUS_COMMON_LINKAGE macro).
00148 **             void f();
00149 **
00150 **             // Is not exported (despite the PEGASUS_COMMON_LINKAGE macro).
00151 **             PEGASUS_HIDDEN_LINKAGE void g(); // not-exported.
00152 **         };
00153 **
00154 **     Notes: this macro has an empty expansion on many platforms since this
00155 **     feature is compiler specific.
00156 **
00157 **==============================================================================
00158 */
00159 #ifndef PEGASUS_HIDDEN_LINKAGE
00160 # define PEGASUS_HIDDEN_LINKAGE /* empty */
00161 #endif
00162 
00163 #ifdef PEGASUS_HAVE_NAMESPACES
00164 #ifdef __cplusplus
00165 # define PEGASUS_NAMESPACE_BEGIN namespace Pegasus {
00166 # define PEGASUS_NAMESPACE_END }
00167 # define PEGASUS_NAMESPACE(X) Pegasus::X
00168 
00169 #ifndef PEGASUS_HAVE_NO_STD
00170 # define PEGASUS_STD(X) std::X
00171 # define PEGASUS_USING_STD using namespace std
00172 #else
00173 # define PEGASUS_STD(X) X
00174 # define PEGASUS_USING_STD
00175 #endif
00176 # define PEGASUS_USING_PEGASUS using namespace Pegasus
00177 #else
00178 # define PEGASUS_NAMESPACE_BEGIN /* empty */
00179 # define PEGASUS_NAMESPACE_END /* empty */
00180 # define PEGASUS_NAMESPACE(X) X
00181 # define PEGASUS_STD(X) X
00182 # define PEGASUS_USING_STD
00183 # define PEGASUS_USING_PEGASUS
00184 #endif
00185 #else
00186 # define PEGASUS_NAMESPACE_BEGIN /* empty */
00187 # define PEGASUS_NAMESPACE_END /* empty */
00188 # define PEGASUS_NAMESPACE(X) X
00189 # define PEGASUS_STD(X) X
00190 # define PEGASUS_USING_STD
00191 # define PEGASUS_USING_PEGASUS
00192 #endif
00193 
00194 #ifdef PEGASUS_HAVE_EXPLICIT
00195 #ifdef __cplusplus
00196 # define PEGASUS_EXPLICIT explicit
00197 #else
00198 # define PEGASUS_EXPLICIT /* empty */
00199 #endif
00200 #else
00201 # define PEGASUS_EXPLICIT /* empty */
00202 #endif
00203 
00204 #ifndef PEGASUS_HAVE_FOR_SCOPE
00205 # define for if (0) ; else for
00206 #endif
00207 
00208 #ifdef PEGASUS_HAVE_TEMPLATE_SPECIALIZATION
00209 #ifdef __cplusplus
00210 # define PEGASUS_TEMPLATE_SPECIALIZATION template <>
00211 #else
00212 # define PEGASUS_TEMPLATE_SPECIALIZATION
00213 #endif
00214 #else
00215 # define PEGASUS_TEMPLATE_SPECIALIZATION
00216 #endif
00217 
00218 #ifdef PEGASUS_HAVE_IOS_BINARY
00219 #ifdef __cplusplus
00220 #define PEGASUS_IOS_BINARY ,std::ios::binary
00221 #define PEGASUS_OR_IOS_BINARY | std::ios::binary
00222 #else
00223 #define PEGASUS_IOS_BINARY /* empty */
00224 #define PEGASUS_OR_IOS_BINARY /* empty */
00225 #endif
00226 #else
00227 #define PEGASUS_IOS_BINARY /* empty */
00228 #define PEGASUS_OR_IOS_BINARY /* empty */
00229 #endif
00230 
00231 #ifndef PEGASUS_SINT64_LITERAL
00232 #define PEGASUS_SINT64_LITERAL(X) (Sint64 (X##LL))
00233 #endif
00234 #ifndef PEGASUS_UINT64_LITERAL
00235 #define PEGASUS_UINT64_LITERAL(X) (Uint64 (X##ULL))
00236 #endif
00237 
00238 /* Used in printf and scanf conversion strings for Uint64 and Sint64 args */
00239 #ifndef PEGASUS_64BIT_CONVERSION_WIDTH
00240 #define PEGASUS_64BIT_CONVERSION_WIDTH "ll"
00241 #endif
00242 
00243 #ifndef PEGASUS_MAXHOSTNAMELEN
00244 # ifdef _POSIX_HOST_NAME_MAX
00245 #  define PEGASUS_MAXHOSTNAMELEN _POSIX_HOST_NAME_MAX
00246 # else
00247 #  define PEGASUS_MAXHOSTNAMELEN MAXHOSTNAMELEN
00248 # endif
00249 #endif
00250 
00251 #ifdef __cplusplus
00252 PEGASUS_NAMESPACE_BEGIN
00253 
00254 typedef bool Boolean;
00255 typedef unsigned char Uint8;
00256 typedef signed char Sint8;
00257 typedef unsigned short Uint16;
00258 typedef signed short Sint16;
00259 typedef unsigned int Uint32;
00260 typedef signed int Sint32;
00261 typedef float Real32;
00262 typedef double Real64;
00263 typedef PEGASUS_UINT64 Uint64;
00264 typedef PEGASUS_SINT64 Sint64;
00265 
00266 #define PEG_NOT_FOUND Uint32(-1)
00267 
00268 PEGASUS_NAMESPACE_END
00269 #endif
00270 
00271 #ifdef PEGASUS_SUPPRESS_UNREACHABLE_STATEMENTS
00272 # define PEGASUS_UNREACHABLE(CODE)
00273 #else
00274 # define PEGASUS_UNREACHABLE(CODE) CODE
00275 #endif
00276 
00277 /*
00278 **==============================================================================
00279 **
00280 ** PEGASUS_FORMAT
00281 **
00282 **     This macro allows the compiler to check the arguments to format
00283 **     specifiers in the printf family of functions. For example, the following
00284 **     enables format checking for the foo function.
00285 **
00286 **         PEGASUS_FORMAT(1, 2)
00287 **         void foo(const char* format, ...);
00288 **
00289 **     On GCC, the following error is detected  below (when using this macro).
00290 **
00291 **         foo("%s %d", 99, "hello"); // mismatch specifiers!
00292 **
00293 **==============================================================================
00294 */
00295 
00296 #if defined(__GNUC__) &&  (__GNUC__ >= 4)
00297 # define PEGASUS_FORMAT(A1, A2) __attribute__((format (printf, A1, A2)))
00298 #else
00299 # define PEGASUS_FORMAT(A1, A2) /* not implemented */
00300 #endif
00301 
00302 
00303 #endif  /* Pegasus_Config_h */