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