diff options
Diffstat (limited to 'ace')
-rw-r--r-- | ace/ACE.cpp | 2 | ||||
-rw-r--r-- | ace/ACE.h | 2 | ||||
-rw-r--r-- | ace/Array.cpp | 139 | ||||
-rw-r--r-- | ace/Array.h | 147 | ||||
-rw-r--r-- | ace/Array.i | 82 | ||||
-rw-r--r-- | ace/Containers.cpp | 124 | ||||
-rw-r--r-- | ace/Containers.h | 134 | ||||
-rw-r--r-- | ace/Containers.i | 79 | ||||
-rw-r--r-- | ace/Dirent.cpp | 6 | ||||
-rw-r--r-- | ace/Dirent.h | 19 | ||||
-rw-r--r-- | ace/Dirent.i | 2 | ||||
-rw-r--r-- | ace/OS.cpp | 7 | ||||
-rw-r--r-- | ace/OS.h | 10 | ||||
-rw-r--r-- | ace/OS.i | 26 | ||||
-rw-r--r-- | ace/Object_Manager.cpp | 1 | ||||
-rw-r--r-- | ace/Template_Instantiations.cpp | 2 |
16 files changed, 386 insertions, 396 deletions
diff --git a/ace/ACE.cpp b/ace/ACE.cpp index f23cd437c19..80e395532ec 100644 --- a/ace/ACE.cpp +++ b/ace/ACE.cpp @@ -13,7 +13,7 @@ #if defined (ACE_LACKS_INLINE_FUNCTIONS) #include "ace/ACE.i" -#endif +#endif /* ACE_LACKS_INLINE_FUNCTIONS */ ACE_RCSID(ace, ACE, "$Id$") diff --git a/ace/ACE.h b/ace/ACE.h index 7b9e3c09cc3..2cd3cca4158 100644 --- a/ace/ACE.h +++ b/ace/ACE.h @@ -639,6 +639,6 @@ private: #if !defined (ACE_LACKS_INLINE_FUNCTIONS) #include "ace/ACE.i" -#endif +#endif /* ACE_LACKS_INLINE_FUNCTIONS */ #endif /* ACE_ACE_H */ diff --git a/ace/Array.cpp b/ace/Array.cpp deleted file mode 100644 index 07de0c3c08b..00000000000 --- a/ace/Array.cpp +++ /dev/null @@ -1,139 +0,0 @@ -// $Id$ - -#if !defined (ARRAY_C) -#define ARRAY_C - -#define ACE_BUILD_DLL -#include "ace/Array.h" - -#if !defined (__ACE_INLINE__) -#include "ace/Array.i" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(ace, Array, "$Id$") - -// Dynamically initialize an array. - -template <class T> -ACE_Array<T>::ACE_Array (size_t size) - : max_size_ (size), - cur_size_ (size) -{ - ACE_NEW (this->array_, T[size]); -} - -template <class T> -ACE_Array<T>::ACE_Array (size_t size, - const T &default_value) - : max_size_ (size), - cur_size_ (size) -{ - ACE_NEW (this->array_, T[size]); - - for (size_t i = 0; i < size; i++) - this->array_[i] = default_value; -} - -// The copy constructor (performs initialization). - -template <class T> -ACE_Array<T>::ACE_Array (const ACE_Array<T> &s) - : max_size_ (s.size ()), - cur_size_ (s.size ()) -{ - ACE_NEW (this->array_, T[s.size ()]); - - for (size_t i = 0; i < this->size (); i++) - this->array_[i] = s.array_[i]; -} - -// Assignment operator (performs assignment). - -template <class T> void -ACE_Array<T>::operator= (const ACE_Array<T> &s) -{ - // Check for "self-assignment". - - if (this == &s) - return; - else if (this->max_size_ < s.size ()) - { - delete [] this->array_; - - ACE_NEW (this->array_, T[s.size ()]); - - this->max_size_ = s.size (); - } - - this->cur_size_ = s.size (); - - for (size_t i = 0; i < this->size (); i++) - this->array_[i] = s.array_[i]; -} - -// Set an item in the array at location index. - -template <class T> int -ACE_Array<T>::set (const T &new_item, size_t index) -{ - if (this->in_range (index)) - { - this->array_[index] = new_item; - return 0; - } - else - return -1; -} - -// Get an item in the array at location index. - -template <class T> int -ACE_Array<T>::get (T &item, size_t index) const -{ - if (this->in_range (index)) - { - item = this->array_[index]; // Copies the item. If you don't - // want to copy, use operator [] instead - // (but then you'll be responsible for - // range checking). - return 0; - } - else - return -1; -} - -// Compare this array with <s> for equality. - -template <class T> int -ACE_Array<T>::operator== (const ACE_Array<T> &s) const -{ - if (this == &s) - return 1; - else if (this->cur_size_ != s.cur_size_) - return 0; - - for (size_t index = 0; index < s.cur_size_; index++) - if (this->array_[index] != s.array_[index]) - return 0; - - return 1; -} - -template <class T> int -ACE_Array_Iterator<T>::next (T *&item) -{ - // ACE_TRACE ("ACE_Array_Iterator<T>::next"); - - if (this->done ()) - { - item = 0; - return 0; - } - else - { - item = &array_[current_]; - return 1; - } -} - -#endif /* ARRAY_C */ diff --git a/ace/Array.h b/ace/Array.h index b39d2dc37ed..2b21ea5ee5b 100644 --- a/ace/Array.h +++ b/ace/Array.h @@ -9,6 +9,10 @@ // = FILENAME // Array.h // +// = DESCRIPTION +// NOTE: this file has been deprecated and will soon go away. You +// should directly include "Containers.h" instead. +// // = AUTHOR // Doug Schmidt // @@ -17,153 +21,18 @@ #if !defined (ACE_ARRAY_H) #define ACE_ARRAY_H -#include "ace/ACE.h" - -// Forward declaration. -template <class T> class ACE_Array_Iterator; - -template <class T> -class ACE_Array -{ - // = TITLE - // Implement a dynamic array class. -public: - // Define a "trait" - typedef T TYPE; - - // = Exceptions. - - // = Initialization and termination methods. - - ACE_Array (size_t size); - // Dynamically create an uninitialized array. - - ACE_Array (size_t size, const T &default_value); - // Dynamically initialize the entire array to the <default_value>. - - ACE_Array (const ACE_Array<T> &s); - // The copy constructor performs initialization by making an exact - // copy of the contents of parameter <s>, i.e., *this == s will - // return true. - - void operator= (const ACE_Array<T> &s); - // Assignment operator performs an assignment by making an exact - // copy of the contents of parameter <s>, i.e., *this == s will - // return true. Note that if the <max_size_> of <array_> is >= than - // <s.max_size_> we can copy it without reallocating. However, if - // <max_size_> is < <s.max_size_> we must delete the <array_>, - // reallocate a new <array_>, and then copy the contents of <s>. - - ~ACE_Array (void); - // Clean up the array (e.g., delete dynamically allocated memory). - - // = Set/get methods. - - T &operator [] (size_t index); - // Set item in the array at location <index>. Doesn't - // perform range checking. - - const T &operator [] (size_t index) const; - // Get item in the array at location <index>. Doesn't - // perform range checking. - - int set (const T &new_item, size_t index); - // Set an item in the array at location <index>. Returns - // -1 if <index> is not in range, else returns 0. - - int get (T &item, size_t index) const; - // Get an item in the array at location <index>. Returns -1 if - // <index> is not in range, else returns 0. Note that this function - // copies the item. If you want to avoid the copy, you can use - // the const operator [], but then you'll be responsible for range checking. - - size_t size (void) const; - // Returns the <cur_size_> of the array. - - int operator== (const ACE_Array<T> &s) const; - // Compare this array with <s> for equality. Two arrays are equal - // if their size()'s are equal and all the elements from 0 .. size() - // are equal. - - int operator!= (const ACE_Array<T> &s) const; - // Compare this array with <s> for inequality such that <*this> != - // <s> is always the complement of the boolean return value of - // <*this> == <s>. - -private: - int in_range (size_t index) const; - // Returns 1 if <index> is within range, i.e., 0 >= <index> < - // <cur_size_>, else returns 0. - - size_t max_size_; - // Maximum size of the array, i.e., the total number of <T> elements - // in <array_>. - - size_t cur_size_; - // Current size of the array. This starts out being == to - // <max_size_>. However, if we are assigned a smaller array, then - // <cur_size_> will become less than <max_size_>. The purpose of - // keeping track of both sizes is to avoid reallocating memory if we - // don't have to. - - T *array_; - // Pointer to the array's storage buffer. - - friend class ACE_Array_Iterator<T>; -}; - -template <class T> -class ACE_Array_Iterator -{ - // = TITLE - // Implement an iterator over an ACE_Array. - // - // = DESCRIPTION - // This iterator is safe in the face of array element deletions. - // But it is NOT safe if the array is resized (via the ACE_Array - // assignment operator) during iteration. That would be very - // odd, and dangerous. -public: - // = Initialization method. - ACE_Array_Iterator (ACE_Array<T> &); - - // = Iteration methods. - - int next (T *&next_item); - // Pass back the <next_item> that hasn't been seen in the Array. - // Returns 0 when all items have been seen, else 1. - - int advance (void); - // Move forward by one element in the Array. Returns 0 when all the - // items in the Array have been seen, else 1. - - int done (void) const; - // Returns 1 when all items have been seen, else 0. - - void dump (void) const; - // Dump the state of an object. - - ACE_ALLOC_HOOK_DECLARE; - // Declare the dynamic allocation hooks. - -private: - u_int current_; - // Pointer to the current item in the iteration. - - ACE_Array<T> &array_; - // Pointer to the Array we're iterating over. -}; +#include "ace/Containers.h" #if defined (__ACE_INLINE__) -#include "ace/Array.i" +#include "ace/Containers.i" #endif /* __ACE_INLINE__ */ #if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "ace/Array.cpp" +#include "ace/Containers.cpp" #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Array.cpp") +#pragma implementation ("Containers.cpp") #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ #endif /* ACE_ARRAY_H */ diff --git a/ace/Array.i b/ace/Array.i deleted file mode 100644 index eeb415db947..00000000000 --- a/ace/Array.i +++ /dev/null @@ -1,82 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - - -// Clean up the array (e.g., delete dynamically allocated memory). - -template <class T> ACE_INLINE -ACE_Array<T>::~ACE_Array (void) -{ - delete [] this->array_; -} - -template <class T> ACE_INLINE size_t -ACE_Array<T>::size (void) const -{ - return this->cur_size_; -} - -template <class T> ACE_INLINE int -ACE_Array<T>::in_range (size_t index) const -{ - return index < this->cur_size_; -} - -template <class T> ACE_INLINE T & -ACE_Array<T>::operator[] (size_t index) -{ - return this->array_[index]; -} - -template <class T> ACE_INLINE const T & -ACE_Array<T>::operator[] (size_t index) const -{ - return this->array_[index]; -} - -// Compare this array with <s> for inequality. - -template <class T> ACE_INLINE int -ACE_Array<T>::operator!= (const ACE_Array<T> &s) const -{ - return !(*this == s); -} - -template <class T> ACE_INLINE void -ACE_Array_Iterator<T>::dump (void) const -{ - // ACE_TRACE ("ACE_Array_Iterator<T>::dump"); -} - -template <class T> ACE_INLINE -ACE_Array_Iterator<T>::ACE_Array_Iterator (ACE_Array<T> &a) - : current_ (0), - array_ (a) -{ - // ACE_TRACE ("ACE_Array_Iterator<T>::ACE_Array_Iterator"); -} - -template <class T> ACE_INLINE int -ACE_Array_Iterator<T>::advance (void) -{ - // ACE_TRACE ("ACE_Array_Iterator<T>::advance"); - - if (this->current_ < array_.size ()) - { - ++this->current_; - return 1; - } - else - { - // Already finished iterating. - return 0; - } -} - -template <class T> ACE_INLINE int -ACE_Array_Iterator<T>::done (void) const -{ - ACE_TRACE ("ACE_Array_Iterator<T>::done"); - - return this->current_ >= array_.size (); -} diff --git a/ace/Containers.cpp b/ace/Containers.cpp index 9a0cdb29e8c..0b3c403c1ed 100644 --- a/ace/Containers.cpp +++ b/ace/Containers.cpp @@ -2127,4 +2127,128 @@ ACE_Ordered_MultiSet_Iterator<T>::next (T *&item) const return 0; } +// Dynamically initialize an array. + +template <class T> +ACE_Array<T>::ACE_Array (size_t size) + : max_size_ (size), + cur_size_ (size) +{ + ACE_NEW (this->array_, T[size]); +} + +template <class T> +ACE_Array<T>::ACE_Array (size_t size, + const T &default_value) + : max_size_ (size), + cur_size_ (size) +{ + ACE_NEW (this->array_, T[size]); + + for (size_t i = 0; i < size; i++) + this->array_[i] = default_value; +} + +// The copy constructor (performs initialization). + +template <class T> +ACE_Array<T>::ACE_Array (const ACE_Array<T> &s) + : max_size_ (s.size ()), + cur_size_ (s.size ()) +{ + ACE_NEW (this->array_, T[s.size ()]); + + for (size_t i = 0; i < this->size (); i++) + this->array_[i] = s.array_[i]; +} + +// Assignment operator (performs assignment). + +template <class T> void +ACE_Array<T>::operator= (const ACE_Array<T> &s) +{ + // Check for "self-assignment". + + if (this == &s) + return; + else if (this->max_size_ < s.size ()) + { + delete [] this->array_; + + ACE_NEW (this->array_, T[s.size ()]); + + this->max_size_ = s.size (); + } + + this->cur_size_ = s.size (); + + for (size_t i = 0; i < this->size (); i++) + this->array_[i] = s.array_[i]; +} + +// Set an item in the array at location index. + +template <class T> int +ACE_Array<T>::set (const T &new_item, size_t index) +{ + if (this->in_range (index)) + { + this->array_[index] = new_item; + return 0; + } + else + return -1; +} + +// Get an item in the array at location index. + +template <class T> int +ACE_Array<T>::get (T &item, size_t index) const +{ + if (this->in_range (index)) + { + item = this->array_[index]; // Copies the item. If you don't + // want to copy, use operator [] instead + // (but then you'll be responsible for + // range checking). + return 0; + } + else + return -1; +} + +// Compare this array with <s> for equality. + +template <class T> int +ACE_Array<T>::operator== (const ACE_Array<T> &s) const +{ + if (this == &s) + return 1; + else if (this->cur_size_ != s.cur_size_) + return 0; + + for (size_t index = 0; index < s.cur_size_; index++) + if (this->array_[index] != s.array_[index]) + return 0; + + return 1; +} + +template <class T> int +ACE_Array_Iterator<T>::next (T *&item) +{ + // ACE_TRACE ("ACE_Array_Iterator<T>::next"); + + if (this->done ()) + { + item = 0; + return 0; + } + else + { + item = &array_[current_]; + return 1; + } +} + #endif /* ACE_CONTAINERS_C */ diff --git a/ace/Containers.h b/ace/Containers.h index 64485b5a49b..6cbd4e42f08 100644 --- a/ace/Containers.h +++ b/ace/Containers.h @@ -1254,6 +1254,140 @@ private: // Allocation strategy of the set. }; +// Forward declaration. +template <class T> class ACE_Array_Iterator; + +template <class T> +class ACE_Array +{ + // = TITLE + // Implement a dynamic array class. +public: + // Define a "trait" + typedef T TYPE; + + // = Exceptions. + + // = Initialization and termination methods. + + ACE_Array (size_t size); + // Dynamically create an uninitialized array. + + ACE_Array (size_t size, const T &default_value); + // Dynamically initialize the entire array to the <default_value>. + + ACE_Array (const ACE_Array<T> &s); + // The copy constructor performs initialization by making an exact + // copy of the contents of parameter <s>, i.e., *this == s will + // return true. + + void operator= (const ACE_Array<T> &s); + // Assignment operator performs an assignment by making an exact + // copy of the contents of parameter <s>, i.e., *this == s will + // return true. Note that if the <max_size_> of <array_> is >= than + // <s.max_size_> we can copy it without reallocating. However, if + // <max_size_> is < <s.max_size_> we must delete the <array_>, + // reallocate a new <array_>, and then copy the contents of <s>. + + ~ACE_Array (void); + // Clean up the array (e.g., delete dynamically allocated memory). + + // = Set/get methods. + + T &operator [] (size_t index); + // Set item in the array at location <index>. Doesn't + // perform range checking. + + const T &operator [] (size_t index) const; + // Get item in the array at location <index>. Doesn't + // perform range checking. + + int set (const T &new_item, size_t index); + // Set an item in the array at location <index>. Returns + // -1 if <index> is not in range, else returns 0. + + int get (T &item, size_t index) const; + // Get an item in the array at location <index>. Returns -1 if + // <index> is not in range, else returns 0. Note that this function + // copies the item. If you want to avoid the copy, you can use + // the const operator [], but then you'll be responsible for range checking. + + size_t size (void) const; + // Returns the <cur_size_> of the array. + + int operator== (const ACE_Array<T> &s) const; + // Compare this array with <s> for equality. Two arrays are equal + // if their size()'s are equal and all the elements from 0 .. size() + // are equal. + + int operator!= (const ACE_Array<T> &s) const; + // Compare this array with <s> for inequality such that <*this> != + // <s> is always the complement of the boolean return value of + // <*this> == <s>. + +private: + int in_range (size_t index) const; + // Returns 1 if <index> is within range, i.e., 0 >= <index> < + // <cur_size_>, else returns 0. + + size_t max_size_; + // Maximum size of the array, i.e., the total number of <T> elements + // in <array_>. + + size_t cur_size_; + // Current size of the array. This starts out being == to + // <max_size_>. However, if we are assigned a smaller array, then + // <cur_size_> will become less than <max_size_>. The purpose of + // keeping track of both sizes is to avoid reallocating memory if we + // don't have to. + + T *array_; + // Pointer to the array's storage buffer. + + friend class ACE_Array_Iterator<T>; +}; + +template <class T> +class ACE_Array_Iterator +{ + // = TITLE + // Implement an iterator over an ACE_Array. + // + // = DESCRIPTION + // This iterator is safe in the face of array element deletions. + // But it is NOT safe if the array is resized (via the ACE_Array + // assignment operator) during iteration. That would be very + // odd, and dangerous. +public: + // = Initialization method. + ACE_Array_Iterator (ACE_Array<T> &); + + // = Iteration methods. + + int next (T *&next_item); + // Pass back the <next_item> that hasn't been seen in the Array. + // Returns 0 when all items have been seen, else 1. + + int advance (void); + // Move forward by one element in the Array. Returns 0 when all the + // items in the Array have been seen, else 1. + + int done (void) const; + // Returns 1 when all items have been seen, else 0. + + void dump (void) const; + // Dump the state of an object. + + ACE_ALLOC_HOOK_DECLARE; + // Declare the dynamic allocation hooks. + +private: + u_int current_; + // Pointer to the current item in the iteration. + + ACE_Array<T> &array_; + // Pointer to the Array we're iterating over. +}; #if defined (__ACE_INLINE__) #include "ace/Containers.i" diff --git a/ace/Containers.i b/ace/Containers.i index 6dabbd04f5c..c49f95438a4 100644 --- a/ace/Containers.i +++ b/ace/Containers.i @@ -297,3 +297,82 @@ ACE_Ordered_MultiSet<T>::size (void) const // ACE_TRACE ("ACE_Ordered_MultiSet<T>::size"); return this->cur_size_; } + +// Clean up the array (e.g., delete dynamically allocated memory). + +template <class T> ACE_INLINE +ACE_Array<T>::~ACE_Array (void) +{ + delete [] this->array_; +} + +template <class T> ACE_INLINE size_t +ACE_Array<T>::size (void) const +{ + return this->cur_size_; +} + +template <class T> ACE_INLINE int +ACE_Array<T>::in_range (size_t index) const +{ + return index < this->cur_size_; +} + +template <class T> ACE_INLINE T & +ACE_Array<T>::operator[] (size_t index) +{ + return this->array_[index]; +} + +template <class T> ACE_INLINE const T & +ACE_Array<T>::operator[] (size_t index) const +{ + return this->array_[index]; +} + +// Compare this array with <s> for inequality. + +template <class T> ACE_INLINE int +ACE_Array<T>::operator!= (const ACE_Array<T> &s) const +{ + return !(*this == s); +} + +template <class T> ACE_INLINE void +ACE_Array_Iterator<T>::dump (void) const +{ + // ACE_TRACE ("ACE_Array_Iterator<T>::dump"); +} + +template <class T> ACE_INLINE +ACE_Array_Iterator<T>::ACE_Array_Iterator (ACE_Array<T> &a) + : current_ (0), + array_ (a) +{ + // ACE_TRACE ("ACE_Array_Iterator<T>::ACE_Array_Iterator"); +} + +template <class T> ACE_INLINE int +ACE_Array_Iterator<T>::advance (void) +{ + // ACE_TRACE ("ACE_Array_Iterator<T>::advance"); + + if (this->current_ < array_.size ()) + { + ++this->current_; + return 1; + } + else + { + // Already finished iterating. + return 0; + } +} + +template <class T> ACE_INLINE int +ACE_Array_Iterator<T>::done (void) const +{ + ACE_TRACE ("ACE_Array_Iterator<T>::done"); + + return this->current_ >= array_.size (); +} diff --git a/ace/Dirent.cpp b/ace/Dirent.cpp index 5a4899fb1cc..6bf9def4b94 100644 --- a/ace/Dirent.cpp +++ b/ace/Dirent.cpp @@ -1,6 +1,6 @@ // $Id$ #define ACE_BUILD_DLL -#if !defined (__ACE_INLINE__) -#include "Dirent.i" -#endif /* __ACE_INLINE__ */ +#if defined (ACE_LACKS_INLINE_FUNCTIONS) +#include "ace/Dirent.i" +#endif /* ACE_LACKS_INLINE_FUNCTIONS */ diff --git a/ace/Dirent.h b/ace/Dirent.h index 106ff31da19..4b8899955c1 100644 --- a/ace/Dirent.h +++ b/ace/Dirent.h @@ -13,7 +13,7 @@ // Define a portable directory-entry manipulation interface. // // = AUTHOR -// Douglas C. Schmidt +// Douglas C. Schmidt <schmidt@cs.wustl.edu> // // ============================================================================ @@ -22,10 +22,6 @@ #include "ace/OS.h" -#if defined rewinddir -#undef rewinddir -#endif /* rewinddir */ - class ACE_Dirent { // = TITLE @@ -66,10 +62,11 @@ public: // update the st_atime field of the directory each time the // directory is actually read. - struct dirent *readdir_r (dirent *entry); + int readdir_r (struct dirent *entry, + struct dirent **result); // Has the equivalent functionality as <readdir> except that an - // <entry> buffer result must be supplied by the caller to store the - // result. + // <entry> and <result> buffer must be supplied by the caller to + // store the result. // = Manipulators. long telldir (void); @@ -99,8 +96,8 @@ private: // Pointer to the directory stream. }; -#if defined (__ACE_INLINE__) -#include "Dirent.i" -#endif /* __ACE_INLINE__ */ +#if !defined (ACE_LACKS_INLINE_FUNCTIONS) +#include "ace/Dirent.i" +#endif /* ACE_LACKS_INLINE_FUNCTIONS */ #endif /* ACE_DIRENT_H */ diff --git a/ace/Dirent.i b/ace/Dirent.i index 91354aaebf6..41bea130d39 100644 --- a/ace/Dirent.i +++ b/ace/Dirent.i @@ -33,7 +33,7 @@ Dirent::readdir (void) return ACE_OS::readdir (this->dirp_); } -ACE_INLINE int * +ACE_INLINE int Dirent::readdir_r (struct dirent *entry, struct dirent **result) { diff --git a/ace/OS.cpp b/ace/OS.cpp index d399b780f68..cfd601b27a3 100644 --- a/ace/OS.cpp +++ b/ace/OS.cpp @@ -1171,11 +1171,8 @@ int ACE_OS::socket_initialized_; #if defined (ACE_WIN32) || defined (ACE_HAS_TSS_EMULATION) -# include "ace/Array.h" - -// moved class ACE_TSS_Ref declaration -// to OS.h so it can be visible to the -// single file of template instantiations +// Moved class ACE_TSS_Ref declaration to OS.h so it can be visible to +// the single file of template instantiations. ACE_TSS_Ref::ACE_TSS_Ref (ACE_thread_t id) : tid_(id) @@ -3928,6 +3928,10 @@ typedef int ucontext_t; # undef t_errno # endif /* ACE_HAS_BROKEN_T_ERRNO */ +#if defined rewinddir +#undef rewinddir +#endif /* rewinddir */ + class ACE_Export ACE_Thread_ID { // = TITLE @@ -4338,9 +4342,9 @@ public: static DIR *opendir (const char *filename); static void closedir (DIR *); static struct dirent *readdir (DIR *); - static int *readdir_r (DIR *dirp, - struct dirent *entry, - struct dirent **entry); + static int readdir_r (DIR *dirp, + struct dirent *entry, + struct dirent **result); static long telldir (DIR *); static void seekdir (DIR *, long loc); @@ -10238,7 +10238,7 @@ ACE_INLINE DIR * ACE_OS::opendir (const char *filename) { #if defined (ACE_HAS_DIRENT) - return opendir (dirname); + return ::opendir (filename); #else ACE_UNUSED_ARG (filename); ACE_NOTSUP_RETURN (0); @@ -10249,7 +10249,7 @@ ACE_INLINE void ACE_OS::closedir (DIR *d) { #if defined (ACE_HAS_DIRENT) - closedir (d); + ::closedir (d); #else ACE_UNUSED_ARG (d); #endif /* ACE_HAS_DIRENT */ @@ -10259,20 +10259,26 @@ ACE_INLINE struct dirent * ACE_OS::readdir (DIR *d) { #if defined (ACE_HAS_DIRENT) - return readdir (d); + return ::readdir (d); #else ACE_UNUSED_ARG (d); ACE_NOTSUP_RETURN (0); #endif /* ACE_HAS_DIRENT */ } -ACE_INLINE int * +ACE_INLINE int ACE_OS::readdir_r (DIR *dirp, struct dirent *entry, - struct dirent **result); + struct dirent **result) { #if defined (ACE_HAS_DIRENT) - return readdir_r (dirp, entry, result); +#if defined (_POSIX_PTHREAD_SEMANTICS) + return ::readdir_r (dirp, entry, result); +#else + // <result> had better not be 0! + *result = ::readdir_r (dirp, entry); + return 0; +#endif /* _POSIX_PTHREAD_SEMANTICS */ #else ACE_UNUSED_ARG (dirp); ACE_UNUSED_ARG (entry); @@ -10285,7 +10291,7 @@ ACE_INLINE long ACE_OS::telldir (DIR *d) { #if defined (ACE_HAS_DIRENT) - return telldir (d); + return ::telldir (d); #else ACE_UNUSED_ARG (d); ACE_NOTSUP_RETURN (-1); @@ -10296,7 +10302,7 @@ ACE_INLINE void ACE_OS::seekdir (DIR *d, long loc) { #if defined (ACE_HAS_DIRENT) - seekdir (d, loc); + ::seekdir (d, loc); #else ACE_UNUSED_ARG (d); ACE_UNUSED_ARG (loc); @@ -10307,7 +10313,9 @@ ACE_INLINE void ACE_OS::rewinddir (DIR *d) { #if defined (ACE_HAS_DIRENT) - rewinddir (d); + // We need to implement <rewinddir> using <seekdir> since it's often + // defined as a macro... + ::seekdir (d, long (0)); #else ACE_UNUSED_ARG (d); #endif /* ACE_HAS_DIRENT */ diff --git a/ace/Object_Manager.cpp b/ace/Object_Manager.cpp index f897cd06496..76c37a5c8f0 100644 --- a/ace/Object_Manager.cpp +++ b/ace/Object_Manager.cpp @@ -12,7 +12,6 @@ #include "ace/Signal.h" #include "ace/Log_Msg.h" #include "ace/Containers.h" -#include "ace/Array.h" #include "ace/Synch.h" #include "ace/Malloc.h" #include "ace/Signal.h" diff --git a/ace/Template_Instantiations.cpp b/ace/Template_Instantiations.cpp index bf5cb32a939..6a8f254c567 100644 --- a/ace/Template_Instantiations.cpp +++ b/ace/Template_Instantiations.cpp @@ -14,7 +14,7 @@ // header files that are not already included #include "ace/Local_Tokens.h" #include "ace/Token.h" -#include "ace/Array.h" +#include "ace/Containers.h" #include "ace/Obstack.h" #include "ace/Select_Reactor.h" #include "ace/Message_Queue.h" |