dbertoni    00/02/17 12:24:35

  Modified:    c/src/Include DOMHelper.hpp PlatformDefinitions.hpp
  Log:
  Changes for Linux build.
  
  Revision  Changes    Path
  1.3       +79 -127   xml-xalan/c/src/Include/DOMHelper.hpp
  
  Index: DOMHelper.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/Include/DOMHelper.hpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DOMHelper.hpp     2000/01/28 15:00:26     1.2
  +++ DOMHelper.hpp     2000/02/17 20:24:35     1.3
  @@ -76,178 +76,122 @@
   
   
   
  -#if 0
  -template<class T>
  -inline int
  -operator==(void*             theAddress,
  -                const T&             theProxy)
  +inline bool
  +operator==(
  +                     int                                     /* theAddress 
*/,
  +                     const DOM_Node&         theObject)
   {
  -     return theProxy.operator==(reinterpret_cast<const 
DOM_NullPtr*>(theAddress));
  +     return theObject == static_cast<const DOM_NullPtr*>(0);
   }
  -#else
   
  -inline int
  -operator==(void*                     theAddress,
  -                const DOM_Node&      theProxy)
  -{
  -     return theProxy.operator==(reinterpret_cast<const 
DOM_NullPtr*>(theAddress));
  -}
   
  -inline int
  -operator==(void*                                     theAddress,
  -                const DOM_NamedNodeMap&      theProxy)
  -{
  -     return theProxy.operator==(reinterpret_cast<const 
DOM_NullPtr*>(theAddress));
  -}
   
  -inline int
  -operator==(void*                             theAddress,
  -                const DOM_NodeList&  theProxy)
  +inline bool
  +operator==(
  +                     int                                     /* theAddress 
*/,
  +                     const DOM_NamedNodeMap&         theObject)
   {
  -     return theProxy.operator==(reinterpret_cast<const 
DOM_NullPtr*>(theAddress));
  +     return theObject == static_cast<const DOM_NullPtr*>(0);
   }
   
  -#endif
   
  -#if  defined(__GNUC__)
  +inline bool
  +operator==(
  +                     int                                     /* theAddress 
*/,
  +                     const DOM_NodeList&             theObject)
  +{
  +     return theObject == static_cast<const DOM_NullPtr*>(0);
  +}
   
   
  -// Doesn't recognize 0 as a possible void *
  -// If this was a template, then it tries to do all sorts of nasty conversions
  -// that we don't want
   
  -inline int
  -operator!=(const DOM_Node&           theProxy,
  -                int          theAddress)
  +inline bool
  +operator==(
  +                     const DOM_Node&         theObject,
  +                     int                                     /* theAddress 
*/)
   {
  -     void *p = reinterpret_cast<void*>(theAddress);
  -     return !(p == theProxy);
  +     return theObject == static_cast<const DOM_NullPtr*>(0);
   }
   
  -inline int
  -operator!=(const DOM_NamedNodeMap&           theProxy,
  -                int          theAddress)
  -{
  -     void *p = reinterpret_cast<void*>(theAddress);
  -     return !(p == theProxy);
  -}
   
  -inline int
  -operator!=(const DOM_NodeList&               theProxy,
  -                int          theAddress)
  -{
  -     void *p = reinterpret_cast<void*>(theAddress);
  -     return !(p == theProxy);
  -}
   
  -inline int
  -operator!=(int               theAddress,
  -                const DOM_Node&              theProxy)
  +inline bool
  +operator==(
  +                     const DOM_NamedNodeMap&         theObject,
  +                     int                                                     
/* theAddress */)
   {
  -     void *p = reinterpret_cast<void*>(theAddress);
  -     return !(p == theProxy);
  +     return theObject == static_cast<const DOM_NullPtr*>(0);
   }
   
  -inline int
  -operator!=(int               theAddress,
  -                const DOM_NamedNodeMap&              theProxy)
  -{
  -     void *p = reinterpret_cast<void*>(theAddress);
  -     return !(p == theProxy);
  -}
  +
   
  -inline int
  -operator!=(int               theAddress,
  -                const DOM_NodeList&          theProxy)
  +inline bool
  +operator==(
  +                     const DOM_NodeList&             theObject,
  +                     int                                             /* 
theAddress */)
   {
  -     void *p = reinterpret_cast<void*>(theAddress);
  -     return !(p == theProxy);
  +     return theObject == static_cast<const DOM_NullPtr*>(0);
   }
   
   
  -#else
   
  -template<class T>
  -inline int
  -operator!=(void*             theAddress,
  -                const T&             theProxy)
  +inline bool
  +operator!=(
  +                     int                                     /* theAddress 
*/,
  +                     const DOM_Node&         theObject)
   {
  -     return !(theAddress == theProxy);
  +     return theObject != static_cast<const DOM_NullPtr*>(0);
   }
   
  -template<class T>
  -inline int
  -operator!=(const T&          theProxy,
  -                void*                theAddress)
  -{
  -     return !(theAddress == theProxy);
  -}
   
  -#endif
   
  -template<class T, class U>
  -class DOM_ConstSurrogate
  +inline bool
  +operator!=(
  +                     int                                                     
/* theAddress */,
  +                     const DOM_NamedNodeMap&         theObject)
   {
  -public:
  +     return theObject != static_cast<const DOM_NullPtr*>(0);
  +}
   
  -     DOM_ConstSurrogate(const T&             theInstance) :
  -             m_instance(theInstance)
  -     {
  -     }
   
  -     const U&
  -     operator&() const
  -     {
  -             return reinterpret_cast<const U&>(m_instance);
  -     }
   
  -     const U&
  -     operator*() const
  -     {
  -             return reinterpret_cast<const U&>(m_instance);
  -     }
  +inline bool
  +operator!=(
  +                     int                                             /* 
theAddress */,
  +                     const DOM_NodeList&             theObject)
  +{
  +     return theObject != static_cast<const DOM_NullPtr*>(0);
  +}
   
  -     const U*
  -     operator->() const
  -     {
  -             return reinterpret_cast<const U*>(&m_instance);
  -     }
   
  -protected:
   
  -     T       m_instance;
  -};
  +inline bool
  +operator!=(
  +                     const DOM_Node&         theObject,
  +                     int                                     /* theAddress 
*/)
  +{
  +     return theObject != static_cast<const DOM_NullPtr*>(0);
  +}
   
   
   
  -template<class T, class U>
  -class DOM_Surrogate : public DOM_ConstSurrogate<T, U>
  +inline bool
  +operator!=(
  +                     const DOM_NamedNodeMap&         theObject,
  +                     int                                                     
/* theAddress */)
   {
  -public:
  -
  -     DOM_Surrogate(const T&  theInstance) :
  -             DOM_ConstSurrogate(theInstance)
  -     {
  -     }
  +     return theObject != static_cast<const DOM_NullPtr*>(0);
  +}
   
  -     U&
  -     operator&()
  -     {
  -             return reinterpret_cast<U&>(m_instance);
  -     }
   
  -     U&
  -     operator*()
  -     {
  -             return reinterpret_cast<U&>(m_instance);
  -     }
   
  -     U*
  -     operator->()
  -     {
  -             return reinterpret_cast<U*>(&m_instance);
  -     }
  -};
  +inline bool
  +operator!=(
  +                     const DOM_NodeList&             theObject,
  +                     int                                             /* 
theAddress */)
  +{
  +     return theObject != static_cast<const DOM_NullPtr*>(0);
  +}
   
   
   
  @@ -299,7 +243,11 @@
   
   
   // Functor for hashing DOM_Nodes.
  +#if defined(XALAN_NO_NAMESPACES)
  +struct DOM_NodeHashFunction : public unary_function<DOM_Node, size_t>
  +#else
   struct DOM_NodeHashFunction : public std::unary_function<DOM_Node, size_t>
  +#endif
   {
        result_type
        operator() (const argument_type&        theKey) const
  @@ -311,7 +259,11 @@
   
   
   // Functor for hashing DOM_Elements.
  +#if defined(XALAN_NO_NAMESPACES)
  +struct DOM_ElementHashFunction : public unary_function<DOM_Element, size_t>
  +#else
   struct DOM_ElementHashFunction : public std::unary_function<DOM_Element, 
size_t>
  +#endif
   {
        result_type
        operator() (const argument_type&        theKey) const
  
  
  
  1.4       +3 -21     xml-xalan/c/src/Include/PlatformDefinitions.hpp
  
  Index: PlatformDefinitions.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/Include/PlatformDefinitions.hpp,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PlatformDefinitions.hpp   2000/02/03 20:13:13     1.3
  +++ PlatformDefinitions.hpp   2000/02/17 20:24:35     1.4
  @@ -57,28 +57,10 @@
   #if !defined(PLATFORMDEFINITIONS_HEADER_GUARD_1357924680)
   #define PLATFORMDEFINITIONS_HEADER_GUARD_1357924680
   
  -#if defined(_DEBUG)
  -#define XML_DEBUG
  -#endif
  -
   #if defined(_MSC_VER)
  -#    include "VCPPDefinitions.hpp"
  -#else
  -#    if defined(__GNUC__)
  -#            define XALAN_PLATFORM_EXPORT    
  -#            define XALAN_PLATFORM_IMPORT   
  -#            define XALAN_PLATFORM_EXPORT_FUNCTION(T) T 
  -#            define XALAN_PLATFORM_IMPORT_FUNCTION(T) T 
  -#            define XALAN_NO_MEMBER_TEMPLATES
  -#            define XALAN_OLD_AUTO_PTR
  -#            define XALAN_NO_COVARIANT_RETURN_TYPE
  -#            define XALAN_XTREE_BUG
  -#            define XALAN_WIDE_STRING_UCODE_PROBLEM
  -//#          define XALAN_NEED_SPECIAL_NAN_SUPPORT
  -//#          define XALAN_HASH_CONTAINERS_AVAILABLE
  -#    else
  -#            error Unsupported platform!
  -#    endif
  +#include "VCPPDefinitions.hpp"
  +#elif defined(__GNUC__)
  +#include "GCCDefinitions.hpp"
   #endif
   
   
  
  
  

Reply via email to