bionic/libc/include
David 'Digit' Turner c30396f5f2 libc: Fix alphasort() signature (and implementation).
The declaration for alphasort() in <dirent.h> used the deprecated:

  int alphasort(const void*, const void*);

while both Posix and GLibc use instead:

  int alphasort(const struct dirent** a, const struct dirent** b);

See: http://pubs.opengroup.org/onlinepubs/9699919799/functions/alphasort.html

This patch does the following:

- Update the declaration to match Posix/GLibc
- Get rid of the upstream BSD code which isn't compatible with the new
  signature.
- Implement a new trivial alphasort() with the right signature, and
  ensure that it uses strcoll() instead of strcmp().
- Remove Bionic-specific #ifdef .. #else .. #endif block in
  dirent_test.cpp which uses alphasort().

Even through strcoll() currently uses strcmp(), this does the right
thing in the case where we decide to update strcoll() to properly
implement locale-specific ordered comparison.

Change-Id: I4fd45604d8a940aaf2eb0ecd7d73e2f11c9bca96
2012-10-29 07:44:27 -07:00
..
android libc: Add <android/api-level.h> 2010-12-06 12:05:11 +01:00
arpa Upgrade more functions to the current upstream NetBSD copy. 2012-10-23 12:29:53 -07:00
net Update the kernel headers to match external/kernel-headers. 2012-09-12 12:30:22 -07:00
netinet Update the kernel headers to match external/kernel-headers. 2012-09-12 12:30:22 -07:00
netpacket auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
sys Upgrade more functions to the current upstream NetBSD copy. 2012-10-23 12:29:53 -07:00
alloca.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
ar.h New additions/bug fixes required/found when porting perf. 2012-03-20 12:54:55 -07:00
assert.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
byteswap.h Fixes for the ARM-specific bswap_16, bswap_32, and bswap_64. 2010-09-26 11:26:53 -07:00
ctype.h Import change from ctype.h revision 1.20 from openbsd 2010-01-15 15:57:02 -08:00
dirent.h libc: Fix alphasort() signature (and implementation). 2012-10-29 07:44:27 -07:00
dlfcn.h fix prototype of dladdr 2011-09-28 12:17:34 -07:00
elf.h Eliminate duplicate constants 2012-02-29 18:43:51 -08:00
endian.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
err.h Add fts, err, and sys/queue for grep 2010-01-15 15:57:02 -08:00
errno.h Fix a ENOTUP/ENOTSUP typo. 2012-08-02 15:45:04 -07:00
fcntl.h disable _FORTIFY_SOURCE under clang 2012-08-29 12:47:41 -07:00
features.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
fnmatch.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
fts.h Add fts, err, and sys/queue for grep 2010-01-15 15:57:02 -08:00
ftw.h libc: add ftw / nftw functions 2012-09-13 16:54:57 -07:00
getopt.h libc: tag missing functions in system headers. 2010-10-09 17:56:55 +02:00
grp.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
inttypes.h Remove compiler warnings when building Bionic. 2010-06-22 17:51:41 -07:00
lastlog.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
libgen.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
limits.h LONG_LONG_MIN/MAX: Move declarations to <limits.h> 2012-10-15 18:52:55 +02:00
link.h Add link.h for all platforms with dl_phdr_info 2012-08-17 12:44:23 -07:00
locale.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
malloc.h Upgrade to dlmalloc 2.8.5. 2012-08-20 14:12:20 -07:00
memory.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
mntent.h mntent.h requires stdio.h 2010-01-15 15:57:02 -08:00
netdb.h Update the kernel headers to match external/kernel-headers. 2012-09-12 12:30:22 -07:00
nsswitch.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
pathconf.h libc: Add missing C++ guards to <pathconf.h> 2010-09-27 17:27:14 +02:00
paths.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
poll.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
pthread.h LONG_LONG_MIN/MAX: Move declarations to <limits.h> 2012-10-15 18:52:55 +02:00
pwd.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
regex.h Import regex from OpenBSD 2010-01-15 15:01:44 -08:00
resolv.h libc: remove private declarations from <time.h> and <resolv.h> 2012-01-13 14:24:08 +01:00
sched.h Update MS_ mount flags, define unshare() syscall. 2012-08-14 12:09:25 -07:00
search.h New additions/bug fixes required/found when porting perf. 2012-03-20 12:54:55 -07:00
semaphore.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
setjmp.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
sgtty.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
sha1.h Upgrade more functions to the current upstream NetBSD copy. 2012-10-23 12:29:53 -07:00
signal.h Revert "libc: Provide ucontext_t/mcontext_t/<sys/ucontext.h>" 2012-10-17 19:10:11 +02:00
stdint.h Always define the 64-bit int types. 2012-08-17 14:30:06 -07:00
stdio.h Add missing BEGIN_DECLS/END_DECLS for FORTIFY_SOURCE stdio prototypes. 2012-10-22 16:10:27 -07:00
stdlib.h Remove useless #defines and incorrect claims from header files. 2012-10-01 15:12:40 -07:00
string.h disable _FORTIFY_SOURCE under clang 2012-08-29 12:47:41 -07:00
strings.h _FORTIFY_SOURCE: add memset / bzero support 2012-06-07 14:19:52 -07:00
syslog.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
termio.h libc: Add missing <termio.h> header 2010-06-11 14:39:39 -07:00
termios.h termios: add tcdrain 2012-09-04 14:11:28 +02:00
time64.h libc: allow usage of time64.h from cpp code 2009-11-23 16:25:32 -05:00
time.h Revert "libc: Provide ucontext_t/mcontext_t/<sys/ucontext.h>" 2012-10-17 19:10:11 +02:00
unistd.h Add getsid system call to bionic 2012-09-03 01:38:34 +03:00
util.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
utime.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00
utmp.h libc: remove C++ comments from public headers. 2010-09-27 17:35:26 +02:00
wchar.h Remove useless #defines and incorrect claims from header files. 2012-10-01 15:12:40 -07:00
wctype.h auto import from //depot/cupcake/@135843 2009-03-03 19:28:35 -08:00