summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlli Savia <ops@iki.fi>2007-02-22 11:25:18 +0000
committerOlli Savia <ops@iki.fi>2007-02-22 11:25:18 +0000
commitf108a107c13598eb3515e61b3773b69b205e4bdc (patch)
treefa9cf59bc14c5393ac93de6182c957abe865cdfd
parentc052bb94bb36d0eea168649593ca3b4f507731c5 (diff)
downloadATCD-f108a107c13598eb3515e61b3773b69b205e4bdc.tar.gz
ChangeLogTag: Thu Feb 22 11:19:59 UTC 2007 Olli Savia <ops@iki.fi>
-rw-r--r--ACE/ChangeLog27
-rw-r--r--ACE/ace/OS_NS_dirent.h3
-rw-r--r--ACE/ace/OS_NS_dirent.inl11
-rw-r--r--ACE/ace/config-lynxos.h1
-rw-r--r--ACE/ace/config-win32-common.h1
-rw-r--r--ACE/ace/os_include/os_dirent.h4
-rw-r--r--ACE/tests/Dirent_Test.cpp2
7 files changed, 44 insertions, 5 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index f80f7737e90..e4cf3424a27 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,22 @@
+Thu Feb 22 11:19:59 UTC 2007 Olli Savia <ops@iki.fi>
+
+ * ace/OS_NS_dirent.h:
+ * ace/OS_NS_dirent.inl:
+ Added ACE_OS::alphasort(). alphasort() is a BSD extension found
+ on Linux as well.
+
+ * ace/config-lynxos.h:
+ Added ACE_LACKS_ALPHASORT_PROTOTYPE.
+
+ * ace/config-win32-common.h:
+ Added ACE_LACKS_ALPHASORT.
+
+ * ace/os_include/os_dirent.h:
+ Added alphasort prototype.
+
+ * tests/Dirent_Test.cpp:
+ Chaged to use use ACE_OS::alphasort().
+
Wed Feb 22 09:24:42 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl>
* ace/Truncate.h (Truncate, truncate_cast):
@@ -116,7 +135,7 @@ Wed Feb 21 19:27:14 UTC 2007 Ossama Othman <ossama_othman at symantec dot com>
* ace/Unbounded_Set.inl:
Implement find() method in terms of begin/end iterators to prevent
- search from looping indefinitely under some race condition
+ search from looping indefinitely under some race condition
scenarios.
Added missing const_iterator factory methods.
@@ -217,7 +236,7 @@ Wed Feb 21 19:27:14 UTC 2007 Ossama Othman <ossama_othman at symantec dot com>
with the handle in an error state. The error code is then
retrieved with getsockopt().
- Good sockets however will return from the select() with ETIME -
+ Good sockets however will return from the select() with ETIME -
in this case return EWOULDBLOCK so the wait strategy can
complete the connection.
@@ -254,8 +273,8 @@ Wed Feb 21 19:27:14 UTC 2007 Ossama Othman <ossama_othman at symantec dot com>
* ace/os_include/os_dlfcn.h (ACE_DEFAULT_SHLIB_MODE):
Added DYNAMIC_PATH to the default flags used to call shl_load()
- on HP 11.00 (PARISC1.1/32-bit) so that RPATH and SHLIB_PATH are
- searched to find the requested .sl.
+ on HP 11.00 (PARISC1.1/32-bit) so that RPATH and SHLIB_PATH are
+ searched to find the requested .sl.
* bin/MakeProjectCreator/templates/gnu.mpd (FORCED_IDL_STUBS):
diff --git a/ACE/ace/OS_NS_dirent.h b/ACE/ace/OS_NS_dirent.h
index 6f3b9b12435..88c4a4b3e34 100644
--- a/ACE/ace/OS_NS_dirent.h
+++ b/ACE/ace/OS_NS_dirent.h
@@ -82,6 +82,9 @@ namespace ACE_OS {
ACE_SCANDIR_COMPARATOR comparator);
ACE_NAMESPACE_INLINE_FUNCTION
+ int alphasort (const void *, const void *);
+
+ ACE_NAMESPACE_INLINE_FUNCTION
void seekdir (ACE_DIR *,
long loc);
diff --git a/ACE/ace/OS_NS_dirent.inl b/ACE/ace/OS_NS_dirent.inl
index a768a914887..56c5d5721aa 100644
--- a/ACE/ace/OS_NS_dirent.inl
+++ b/ACE/ace/OS_NS_dirent.inl
@@ -142,6 +142,17 @@ scandir (const ACE_TCHAR *dirname,
#endif /* ACE_HAS_SCANDIR */
}
+ACE_INLINE int
+alphasort (const void *a, const void *b)
+{
+#if defined (ACE_LACKS_ALPHASORT)
+ return ACE_OS::strcmp ((*(struct dirent **)a)->d_name,
+ (*(struct dirent **)b)->d_name);
+#else
+ return ::alphasort (a, b);
+#endif
+}
+
ACE_INLINE void
seekdir (ACE_DIR *d, long loc)
{
diff --git a/ACE/ace/config-lynxos.h b/ACE/ace/config-lynxos.h
index f1d743c3640..9ec56c1236d 100644
--- a/ACE/ace/config-lynxos.h
+++ b/ACE/ace/config-lynxos.h
@@ -76,6 +76,7 @@
#define ACE_HAS_SYS_SOCKIO_H
#define ACE_HAS_TERMIOS
#define ACE_HAS_TIMEZONE_GETTIMEOFDAY
+#define ACE_LACKS_ALPHASORT_PROTOTYPE
#define ACE_LACKS_CONST_TIMESPEC_PTR
#define ACE_LACKS_GETPGID
#define ACE_LACKS_MADVISE
diff --git a/ACE/ace/config-win32-common.h b/ACE/ace/config-win32-common.h
index 7beabb8ded6..ff7a1979f80 100644
--- a/ACE/ace/config-win32-common.h
+++ b/ACE/ace/config-win32-common.h
@@ -565,6 +565,7 @@
#define ACE_LACKS_OPENDIR
#define ACE_LACKS_CLOSEDIR
#define ACE_LACKS_READDIR
+#define ACE_LACKS_ALPHASORT
#define ACE_LACKS_MKSTEMP
#define ACE_LACKS_LSTAT
// Looks like Win32 has a non-const swab function
diff --git a/ACE/ace/os_include/os_dirent.h b/ACE/ace/os_include/os_dirent.h
index 2f7e12327e7..0f4f6b5fe81 100644
--- a/ACE/ace/os_include/os_dirent.h
+++ b/ACE/ace/os_include/os_dirent.h
@@ -100,6 +100,10 @@ int scandir (const char *,
int (*) (const void *, const void *));
#endif /* ACE_LACKS_SCANDIR_PROTOTYPE */
+#if defined (ACE_LACKS_ALPHASORT_PROTOTYPE)
+int alphasort (const void *, const void *);
+#endif /* ACE_LACKS_ALPHASORT_PROTOTYPE */
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/ACE/tests/Dirent_Test.cpp b/ACE/tests/Dirent_Test.cpp
index eaf2dbfd9c2..c564623aaef 100644
--- a/ACE/tests/Dirent_Test.cpp
+++ b/ACE/tests/Dirent_Test.cpp
@@ -71,7 +71,7 @@ selector (const ACE_DIRENT *d)
static int
comparator (const ACE_DIRENT **d1, const ACE_DIRENT **d2)
{
- return ACE_OS::strcmp ((*d1)->d_name, (*d2)->d_name);
+ return ACE_OS::alphasort (d1, d2);
}
} /* extern "C" */