diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-06-06 04:00:41 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-06-06 04:00:41 +0000 |
commit | 70d628dc9a83c53fee379758d313cffbaacfc15c (patch) | |
tree | faf19acb18584e6b6f49605931c16e1bdd7df210 | |
parent | 0b488cfe0efe3730cd67564c3ba3b3884de41bd2 (diff) | |
download | ATCD-70d628dc9a83c53fee379758d313cffbaacfc15c.tar.gz |
ChangeLogTag:Sat Jun 5 22:57:31 1999 Carlos O'Ryan <coryan@cs.wustl.edu>
-rw-r--r-- | ChangeLog-99b | 18 | ||||
-rw-r--r-- | ace/Filecache.cpp | 12 | ||||
-rw-r--r-- | ace/Functor.h | 29 | ||||
-rw-r--r-- | ace/OS.h | 7 | ||||
-rw-r--r-- | ace/config-sunos5.5.h | 1 |
5 files changed, 61 insertions, 6 deletions
diff --git a/ChangeLog-99b b/ChangeLog-99b index fc5eafb3952..05dec71ee62 100644 --- a/ChangeLog-99b +++ b/ChangeLog-99b @@ -1,3 +1,21 @@ +Sat Jun 5 22:57:31 1999 Carlos O'Ryan <coryan@cs.wustl.edu> + + * ace/OS.h: + Added new macro (ACE_TEMPLATE_SPECIALIZATION) to handle the + differences between compilers supporting the standard way to + specialize a template (i.e. template<> class Foo<int>) vs. the + old style (just saying class Foo<int>). + Also added new macro ACE_HAS_STD_TEMPLATE_SPECIALIZATION that + platforms must define if they want the new style. + + * ace/Filecache.cpp: + * ace/Functor.h: + Use the new ACE_TEMPLATE_SPECIALIZATION macro + + * ace/config-sunos5.5.h: + Define the new ACE_HAS_STD_TEMPLATE_SPECIALIZATION for Sun/CC + 5.0 + Sat Jun 5 16:48:47 1999 Carlos O'Ryan <coryan@cs.wustl.edu> * ace/config-irix6.x-common.h diff --git a/ace/Filecache.cpp b/ace/Filecache.cpp index edf8d04eabe..6d5379eee91 100644 --- a/ace/Filecache.cpp +++ b/ace/Filecache.cpp @@ -136,7 +136,7 @@ ACE_Filecache_Handle::size (void) const #define ACE_Filecache_Hash_Entry \ ACE_Hash_Map_Entry<const char *, ACE_Filecache_Object *> -/* template<> */ +ACE_TEMPLATE_SPECIALIZATION ACE_Filecache_Hash_Entry::ACE_Hash_Map_Entry (const char *const &ext_id, ACE_Filecache_Object *const &int_id, ACE_Filecache_Hash_Entry *next, @@ -148,7 +148,7 @@ ACE_Filecache_Hash_Entry::ACE_Hash_Map_Entry (const char *const &ext_id, { } -/* template<> */ +ACE_TEMPLATE_SPECIALIZATION ACE_Filecache_Hash_Entry::ACE_Hash_Map_Entry (ACE_Filecache_Hash_Entry *next, ACE_Filecache_Hash_Entry *prev) : ext_id_ (0), @@ -157,7 +157,7 @@ ACE_Filecache_Hash_Entry::ACE_Hash_Map_Entry (ACE_Filecache_Hash_Entry *next, { } -/* template<> */ +ACE_TEMPLATE_SPECIALIZATION ACE_Filecache_Hash_Entry::~ACE_Hash_Map_Entry (void) { ACE_OS::free ((void *) ext_id_); @@ -166,13 +166,15 @@ ACE_Filecache_Hash_Entry::~ACE_Hash_Map_Entry (void) // We need these template specializations since KEY is defined as a // char*, which doesn't have a hash() or equal() method defined on it. -/* template<> */ long unsigned int +ACE_TEMPLATE_SPECIALIZATION +unsigned long ACE_Filecache_Hash::hash (const char *const &ext_id) { return ACE::hash_pjw (ext_id); } -/* template<> */ int +ACE_TEMPLATE_SPECIALIZATION +int ACE_Filecache_Hash::equal (const char *const &id1, const char *const &id2) { return ACE_OS::strcmp (id1, id2) == 0; diff --git a/ace/Functor.h b/ace/Functor.h index 567314bff16..ba39fef703f 100644 --- a/ace/Functor.h +++ b/ace/Functor.h @@ -85,6 +85,7 @@ template <class TYPE> class ACE_Hash; template <class TYPE> class ACE_Equal_To; template <class TYPE> class ACE_Less_Than; +ACE_TEMPLATE_SPECIALIZATION class ACE_Export ACE_Hash<char> { // = TITLE @@ -94,6 +95,7 @@ public: // Simply returns t }; +ACE_TEMPLATE_SPECIALIZATION class ACE_Export ACE_Hash<signed char> { // = TITLE @@ -103,6 +105,7 @@ public: // Simply returns t }; +ACE_TEMPLATE_SPECIALIZATION class ACE_Export ACE_Hash<unsigned char> { // = TITLE @@ -112,6 +115,7 @@ public: // Simply returns t }; +ACE_TEMPLATE_SPECIALIZATION class ACE_Export ACE_Hash<short> { // = TITLE @@ -121,6 +125,7 @@ public: // Simply returns t }; +ACE_TEMPLATE_SPECIALIZATION class ACE_Export ACE_Hash<unsigned short> { // = TITLE @@ -130,6 +135,7 @@ public: // Simply returns t }; +ACE_TEMPLATE_SPECIALIZATION class ACE_Export ACE_Hash<int> { // = TITLE @@ -139,6 +145,7 @@ public: // Simply returns t }; +ACE_TEMPLATE_SPECIALIZATION class ACE_Export ACE_Hash<unsigned int> { // = TITLE @@ -148,6 +155,7 @@ public: // Simply returns t }; +ACE_TEMPLATE_SPECIALIZATION class ACE_Export ACE_Hash<long> { // = TITLE @@ -157,6 +165,7 @@ public: // Simply returns t }; +ACE_TEMPLATE_SPECIALIZATION class ACE_Export ACE_Hash<unsigned long> { // = TITLE @@ -166,6 +175,7 @@ public: // Simply returns t }; +ACE_TEMPLATE_SPECIALIZATION class ACE_Export ACE_Hash<ACE_UINT64> { // = TITLE @@ -175,6 +185,7 @@ public: // Simply returns t }; +ACE_TEMPLATE_SPECIALIZATION class ACE_Export ACE_Hash<const char *> { // = TITLE @@ -184,6 +195,7 @@ public: // Calls ACE::hash_pjw }; +ACE_TEMPLATE_SPECIALIZATION class ACE_Export ACE_Hash<char *> { // = TITLE @@ -194,6 +206,7 @@ public: }; #if !defined (ACE_HAS_WCHAR_TYPEDEFS_CHAR) +ACE_TEMPLATE_SPECIALIZATION class ACE_Export ACE_Hash<const wchar_t *> { // = TITLE @@ -203,6 +216,7 @@ public: // Calls ACE::hash_pjw }; +ACE_TEMPLATE_SPECIALIZATION class ACE_Export ACE_Hash<wchar_t *> { // = TITLE @@ -214,6 +228,7 @@ public: #endif /* ! ACE_HAS_WCHAR_TYPEDEFS_CHAR */ #if !defined (ACE_HAS_WCHAR_TYPEDEFS_USHORT) +ACE_TEMPLATE_SPECIALIZATION class ACE_Export ACE_Hash<const ACE_USHORT16 *> { // = TITLE @@ -223,6 +238,7 @@ public: // Calls ACE::hash_pjw }; +ACE_TEMPLATE_SPECIALIZATION class ACE_Export ACE_Hash<ACE_USHORT16 *> { // = TITLE @@ -233,6 +249,7 @@ public: }; #endif /* ! ACE_HAS_WCHAR_TYPEDEFS_USHORT */ +ACE_TEMPLATE_SPECIALIZATION class ACE_Export ACE_Equal_To<const char *> { // = TITLE @@ -243,6 +260,7 @@ public: // Simply calls ACE_OS::strcmp }; +ACE_TEMPLATE_SPECIALIZATION class ACE_Export ACE_Equal_To<char *> { // = TITLE @@ -255,6 +273,7 @@ public: }; #if !defined (ACE_HAS_WCHAR_TYPEDEFS_CHAR) +ACE_TEMPLATE_SPECIALIZATION class ACE_Export ACE_Equal_To<const wchar_t *> { // = TITLE @@ -266,6 +285,7 @@ public: // Simply calls ACE_OS::strcmp }; +ACE_TEMPLATE_SPECIALIZATION class ACE_Export ACE_Equal_To<wchar_t *> { // = TITLE @@ -278,6 +298,7 @@ public: #endif /* ! ACE_HAS_WCHAR_TYPEDEFS_CHAR */ #if !defined (ACE_HAS_WCHAR_TYPEDEFS_USHORT) +ACE_TEMPLATE_SPECIALIZATION class ACE_Export ACE_Equal_To<const ACE_USHORT16 *> { // = TITLE @@ -289,6 +310,7 @@ public: // Simply calls ACE_OS::strcmp }; +ACE_TEMPLATE_SPECIALIZATION class ACE_Export ACE_Equal_To<ACE_USHORT16 *> { // = TITLE @@ -300,7 +322,7 @@ public: }; #endif /* ! ACE_HAS_WCHAR_TYPEDEFS_USHORT */ - +ACE_TEMPLATE_SPECIALIZATION class ACE_Export ACE_Less_Than<const char *> { // = TITLE @@ -312,6 +334,7 @@ public: // Simply calls ACE_OS::strcmp }; +ACE_TEMPLATE_SPECIALIZATION class ACE_Export ACE_Less_Than<char *> { // = TITLE @@ -324,6 +347,7 @@ public: }; #if !defined (ACE_HAS_WCHAR_TYPEDEFS_CHAR) +ACE_TEMPLATE_SPECIALIZATION class ACE_Export ACE_Less_Than<const wchar_t *> { // = TITLE @@ -335,6 +359,7 @@ public: // Simply calls ACE_OS::strcmp }; +ACE_TEMPLATE_SPECIALIZATION class ACE_Export ACE_Less_Than<wchar_t *> { // = TITLE @@ -348,6 +373,7 @@ public: #endif /* ! ACE_HAS_WCHAR_TYPEDEFS_CHAR */ #if !defined (ACE_HAS_WCHAR_TYPEDEFS_USHORT) +ACE_TEMPLATE_SPECIALIZATION class ACE_Export ACE_Less_Than<const ACE_USHORT16 *> { // = TITLE @@ -359,6 +385,7 @@ public: // Simply calls ACE_OS::strcmp }; +ACE_TEMPLATE_SPECIALIZATION class ACE_Export ACE_Less_Than<ACE_USHORT16 *> { // = TITLE @@ -1395,6 +1395,13 @@ private: ACE_Time_Value *max_wait_time_; # define ACE_TYPENAME # endif /* ACE_HAS_TYPENAME_KEYWORD */ +# if defined (ACE_HAS_STD_TEMPLATE_SPECIALIZATION) +# define ACE_TEMPLATE_SPECIALIZATION template<> +# else +# define ACE_TEMPLATE_SPECIALIZATION +# endif /* ACE_HAS_STD_TEMPLATE_SPECIALIZATION */ + + // The following is necessary since many C++ compilers don't support // typedef'd types inside of classes used as formal template // arguments... ;-(. Luckily, using the C++ preprocessor I can hide diff --git a/ace/config-sunos5.5.h b/ace/config-sunos5.5.h index 09ce6c9c72b..6f4202e675e 100644 --- a/ace/config-sunos5.5.h +++ b/ace/config-sunos5.5.h @@ -26,6 +26,7 @@ With CC 5.0, those problems may be fixed. And, this is necessary to work around problems with automatic template instantiation. */ # define ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION +# define ACE_HAS_STD_TEMPLATE_SPECIALIZATION # define ACE_TEMPLATES_REQUIRE_SOURCE # define ACE_HAS_STANDARD_CPP_LIBRARY 1 # define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 |