#ifndef ZMENVIRONMENT_H #define ZMENVIRONMENT_H // ---------------------------------------------------------------------- // // ZMenvironment.h // // History: // 28-Oct-1997 WEB Initial draft // 04-Nov-1997 WEB Updated for new approach to namespace support // 11-Nov-1997 WEB Declare std before using it // 13-Nov-1997 WEB Revert to our prior philosophy: program to the // C++ standard! // 11-Dec-1997 WEB Add support for algorithm // 05-Jan-1998 WEB Incorporate updated DEFECT_STANDARD_CPLUSPLUS // symbol // 14-May-1998 WEB Minor improvements in commentary // 15-Jun-1998 WEB Add namespace support via macro definitions, // #ifdef'd for compatibility testing and transition // 14-Feb-2000 WEB Incorporate ISOcxx compatibility // 08-Mar-2000 WEB Update location of ISOcxx.h header // 10-Aug-2000 WEB Add ZM_QUAL_NAME // 18-Jul-2002 JMM Fix macro that was looking only at GNUC__MINOR // 24-Mar-2003 WEB Embed knowledge of gcc 3 compliance // // ---------------------------------------------------------------------- // --- ISOcxx compatibility: #if defined ISOCXX__ISOCXX #include "ISOcxx/ISOcxx.h" #ifdef ZM_USE_NAMESPACES // Allow zoom's namespace constructs: // #define ZM_BEGIN_NAMESPACE(ns) BEGIN_NAMESPACE(ns) #define ZM_END_NAMESPACE(ns) END_NAMESPACE(ns) #define ZM_USING_NAMESPACE(ns) USING_NAMESPACE(ns) #define ZM_QUAL_NAME(ns,name) QUAL_NAME(ns,name) #define ZM_BEGIN_UNNAMED_NAMESPACE BEGIN_UNNAMED_NAMESPACE #define ZM_END_UNNAMED_NAMESPACE END_UNNAMED_NAMESPACE #else // Ignore zoom's namespace constructs: // #define ZM_BEGIN_NAMESPACE(ns) /* */ #define ZM_END_NAMESPACE(ns) /* */ #define ZM_USING_NAMESPACE(ns) /* */ #define ZM_QUAL_NAME(ns,name) name #define ZM_BEGIN_UNNAMED_NAMESPACE /* */ #define ZM_END_UNNAMED_NAMESPACE /* */ #endif // ZM_USE_NAMESPACES // Some compilers ignore the meaning of the keyword mutable; // for those we can have const member function that changes mutable members: // #ifdef DEFECT_NO_MUTABLE #define mutable_const #else #define mutable_const const #endif #define ZM_COVARIANT_TYPE(BaseClass, SubClass)\ COVARIANT_TYPE(BaseClass, SubClass) // --- original code: #else // ! defined ISOCXX__ISOCXX #if ! defined(DEFECT_STANDARD_CPLUSPLUS)\ && (defined(__GNUC__) && (__GNUC__ >= 3)) #define DEFECT_STANDARD_CPLUSPLUS #endif #if defined(__STANDARD_CPLUSPLUS) || defined(DEFECT_STANDARD_CPLUSPLUS) // trigger standard-conforming header file names (alphabetical order): // #define ZM_STD_cmath #define ZM_STD_iomanip #define ZM_STD_iosfwd #define ZM_STD_iostream #define ZM_STD_fstream #define ZM_STD_sstream #define ZM_USE_STL // Allow zoom's namespace constructs: // #ifndef _MSC_VER // ... but not for MSVC++ //#define ZM_USE_NAMESPACES #endif #ifndef USING #define USING(X) using X; #endif #else // ignore namespace constructs: // #ifndef using #define using #define NOTusing #endif #ifndef std #define std #endif #ifndef USING #define USING(X); #endif #endif // __STANDARD_CPLUSPLUS || DEFECT_STANDARD_CPLUSPLUS // JMM trying to get things to compile under egcs #if defined(__GNUC__) && (__GNUC__ == 2) && (__GNUC_MINOR__ > 90) #define ZM_USE_STL #endif #ifdef ZM_USE_STL #define ZM_STD_algorithm #define ZM_STD_map #endif #ifdef ZM_USE_NAMESPACES // Allow zoom's namespace constructs: // #define ZM_BEGIN_NAMESPACE(ns) namespace ns { #define ZM_END_NAMESPACE(ns) } // ns #define ZM_USING_NAMESPACE(ns) USING(namespace ns); #define ZM_QUAL_NAME(ns,name) ns::name #define ZM_BEGIN_UNNAMED_NAMESPACE namespace { #define ZM_END_UNNAMED_NAMESPACE } #else // Ignore zoom's namespace constructs: // #define ZM_BEGIN_NAMESPACE(ns) /* */ #define ZM_END_NAMESPACE(ns) /* */ #define ZM_USING_NAMESPACE(ns) /* */ #define ZM_QUAL_NAME(ns,name) name #define ZM_BEGIN_UNNAMED_NAMESPACE /* */ #define ZM_END_UNNAMED_NAMESPACE /* */ #endif // ZM_USE_NAMESPACES // Cope with absence of covariant return types: // #ifdef DEFECT_NO_VIRTUAL_COVARIANCE #define ZM_COVARIANT_TYPE(BaseClass, SubClass) BaseClass #else #define ZM_COVARIANT_TYPE(BaseClass, SubClass) SubClass #endif // DEFECT_NO_VIRTUAL_COVARIANCE // Some compilers ignore the meaning of the keyword mutable; // for those we can have const member function that changes mutable members: // #ifdef DEFECT_NO_MUTABLE #define mutable_const #else #define mutable_const const #endif #endif // ISOCXX__ISOCXX // ---------------------------------------------------------------------- #endif // ZMENVIRONMENT_H