Update of /cvsroot/csp/APPLICATIONS/SimData/Include/SimData In directory sc8-pr-cvs1:/tmp/cvs-serv2741/Include/SimData Modified Files: Tag: simdata Enum.h HashUtility.h InterfaceRegistry.h List.h ObjectInterface.h Pack.h hash_map.h Log Message: more gcc 3.2 compatibility fixes Index: Enum.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/Enum.h,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** Enum.h 20 Jan 2003 04:56:49 -0000 1.1.2.3 --- Enum.h 20 Jan 2003 05:53:12 -0000 1.1.2.4 *************** *** 68,72 **** struct hashstring { ! static std::hash<const char*> h; int operator()(const std::string &s) const { return h(s.c_str()); --- 68,72 ---- struct hashstring { ! static HASH<const char*> h; int operator()(const std::string &s) const { return h(s.c_str()); *************** *** 74,82 **** }; ! std::hash<const char*> hashstring::h; } // namespace ! typedef std::hash_map<const std::string, int, hashstring, eqstring> string_map; --- 74,82 ---- }; ! HASH<const char*> hashstring::h; } // namespace ! typedef HASH_MAP<const std::string, int, hashstring, eqstring> string_map; Index: HashUtility.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/HashUtility.h,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** HashUtility.h 20 Jan 2003 04:56:49 -0000 1.1.2.3 --- HashUtility.h 20 Jan 2003 05:53:12 -0000 1.1.2.4 *************** *** 92,103 **** }; ! ! typedef std::hash_map<hasht, int, hasht_hash, hasht_eq> hasht_map; class Object; class ObjectProxyBase; ! typedef std::hash_map<hasht, Object*, hasht_hash, hasht_eq> cache_map; ! typedef std::hash_map<hasht, ObjectProxyBase*, hasht_hash, hasht_eq> proxy_map; --- 92,102 ---- }; ! typedef HASH_MAP<hasht, int, hasht_hash, hasht_eq> hasht_map; class Object; class ObjectProxyBase; ! typedef HASH_MAP<hasht, Object*, hasht_hash, hasht_eq> cache_map; ! typedef HASH_MAP<hasht, ObjectProxyBase*, hasht_hash, hasht_eq> proxy_map; Index: InterfaceRegistry.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/InterfaceRegistry.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** InterfaceRegistry.h 19 Jan 2003 20:28:30 -0000 1.1.2.1 --- InterfaceRegistry.h 20 Jan 2003 05:53:12 -0000 1.1.2.2 *************** *** 160,165 **** private: ! typedef std::hash_map<const char *, InterfaceProxy *, std::hash<const char *>, eqstr> proxy_map; ! typedef std::hash_map<hasht, InterfaceProxy *, hasht_hash, hasht_eq> proxy_id_map; proxy_map *map; proxy_id_map *id_map; --- 160,165 ---- private: ! typedef HASH_MAP<const char *, InterfaceProxy *, HASH<const char *>, eqstr> proxy_map; ! typedef HASH_MAP<hasht, InterfaceProxy *, hasht_hash, hasht_eq> proxy_id_map; proxy_map *map; proxy_id_map *id_map; Index: List.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/List.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** List.h 19 Jan 2003 20:28:30 -0000 1.1.2.1 --- List.h 20 Jan 2003 05:53:12 -0000 1.1.2.2 *************** *** 86,90 **** template<typename T> void List<T>::pack(Packer& p) const { ! std::vector<T>::const_iterator a; p.pack((int)(this->size())); for (a=this->begin(); a!=this->end(); a++) --- 86,90 ---- template<typename T> void List<T>::pack(Packer& p) const { ! typename std::vector<T>::const_iterator a; p.pack((int)(this->size())); for (a=this->begin(); a!=this->end(); a++) Index: ObjectInterface.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/ObjectInterface.h,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** ObjectInterface.h 20 Jan 2003 04:14:42 -0000 1.1.2.2 --- ObjectInterface.h 20 Jan 2003 05:53:12 -0000 1.1.2.3 *************** *** 57,61 **** public: virtual ~MemberAccessorBase() {} ! typedef std::hash_map<const char *, MemberAccessorBase *, std::hash<const char*>, eqstr> map; virtual void set(Object *, TypeAdapter const &) throw(TypeMismatch) { throw TypeMismatch("Cannot set vector<> '" + name + "' directly, use push_back() instead."); --- 57,61 ---- public: virtual ~MemberAccessorBase() {} ! typedef HASH_MAP<const char *, MemberAccessorBase *, HASH<const char*>, eqstr> map; virtual void set(Object *, TypeAdapter const &) throw(TypeMismatch) { throw TypeMismatch("Cannot set vector<> '" + name + "' directly, use push_back() instead."); *************** *** 164,168 **** std::vector<T> &m = object->*member; p.pack(m.size()); ! std::vector<T>::iterator idx; for (idx = m.begin(); idx != m.end(); idx++) { p.pack(*idx); --- 164,168 ---- std::vector<T> &m = object->*member; p.pack(m.size()); ! typename std::vector<T>::iterator idx; for (idx = m.begin(); idx != m.end(); idx++) { p.pack(*idx); Index: Pack.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/Pack.h,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** Pack.h 19 Jan 2003 20:28:30 -0000 1.1.2.1 --- Pack.h 20 Jan 2003 05:53:12 -0000 1.1.2.2 *************** *** 110,114 **** void pack(const std::vector<T>& x) { pack((int)x.size()); ! std::vector<T>::const_iterator i = x.begin(); while (i != x.end()) pack(*i++); } --- 110,114 ---- void pack(const std::vector<T>& x) { pack((int)x.size()); ! typename std::vector<T>::const_iterator i = x.begin(); while (i != x.end()) pack(*i++); } *************** *** 220,224 **** unpack(n); y.resize(n, 0.0); ! std::vector<T>::iterator i = y.begin(); while (n-- > 0) unpack(*i++); } --- 220,224 ---- unpack(n); y.resize(n, 0.0); ! typename std::vector<T>::iterator i = y.begin(); while (n-- > 0) unpack(*i++); } Index: hash_map.h =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Include/SimData/Attic/hash_map.h,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** hash_map.h 20 Jan 2003 04:56:49 -0000 1.1.2.3 --- hash_map.h 20 Jan 2003 05:53:12 -0000 1.1.2.4 *************** *** 2,13 **** --- 2,25 ---- #if __GNUC__ == 3 #include <ext/hash_map> + #if __GNUC_MINOR__ > 0 + #define HASH_MAP __gnu_cxx::hash_map + #define HASH __gnu_cxx::hash + #else + #define HASH_MAP std::hash_map + #define HASH std::hash + #endif #else #include <hash_map> + #define HASH_MAP std::hash_map + #define HASH std::hash #endif #else #ifdef WIN32 #include <hash_map.h> + #define HASH_MAP std::hash_map + #define HASH std::hash #else #error "PLEASE PROVIDE CORRECT #INCLUDE<HASH_MAP> STATEMENT FOR YOUR PLATFORM!" #endif #endif + |