diff options
author | Yaakov Selkowitz <yselkowi@redhat.com> | 2013-09-08 07:11:33 +0000 |
---|---|---|
committer | Yaakov Selkowitz <yselkowi@redhat.com> | 2013-09-08 07:11:33 +0000 |
commit | 45070312d433402354951f6965aea48262faec02 (patch) | |
tree | 0c5b6498c4d8af8bc8e763b86cb4945c98f00f1c /newlib/libc/include/stdlib.h | |
parent | 3c654cd48ad636775e915d99e6c316fbbe8d221d (diff) | |
download | cygnal-45070312d433402354951f6965aea48262faec02.tar.gz cygnal-45070312d433402354951f6965aea48262faec02.tar.bz2 cygnal-45070312d433402354951f6965aea48262faec02.zip |
* libc/include/search.h (__compar_fn_t): Add typedef.
(tdelete, tfind, tsearch): Use it.
* libc/include/stdlib.h (__compar_fn_t): Add typedef.
(bsearch, qsort): Use it.
Diffstat (limited to 'newlib/libc/include/stdlib.h')
-rw-r--r-- | newlib/libc/include/stdlib.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/newlib/libc/include/stdlib.h b/newlib/libc/include/stdlib.h index eee118d56..fc15a3cce 100644 --- a/newlib/libc/include/stdlib.h +++ b/newlib/libc/include/stdlib.h @@ -47,6 +47,11 @@ typedef struct } lldiv_t; #endif +#ifndef __compar_fn_t_defined +#define __compar_fn_t_defined +typedef int (*__compar_fn_t) (const _PTR, const _PTR); +#endif + #define EXIT_FAILURE 1 #define EXIT_SUCCESS 0 @@ -71,7 +76,7 @@ _PTR _EXFUN(bsearch,(const _PTR __key, const _PTR __base, size_t __nmemb, size_t __size, - int _EXFNPTR(_compar,(const _PTR, const _PTR)))); + __compar_fn_t _compar)); _PTR _EXFUN_NOTHROW(calloc,(size_t __nmemb, size_t __size)); div_t _EXFUN(div,(int __numer, int __denom)); _VOID _EXFUN(exit,(int __status) _ATTRIBUTE ((noreturn))); @@ -113,7 +118,7 @@ int _EXFUN(_mkstemp_r, (struct _reent *, char *)); int _EXFUN(_mkstemps_r, (struct _reent *, char *, int)); char * _EXFUN(_mktemp_r, (struct _reent *, char *) _ATTRIBUTE ((__warning__ ("the use of `mktemp' is dangerous; use `mkstemp' instead")))); #endif -_VOID _EXFUN(qsort,(_PTR __base, size_t __nmemb, size_t __size, int(*_compar)(const _PTR, const _PTR))); +_VOID _EXFUN(qsort,(_PTR __base, size_t __nmemb, size_t __size, __compar_fn_t _compar)); int _EXFUN(rand,(_VOID)); _PTR _EXFUN_NOTHROW(realloc,(_PTR __r, size_t __size)); #ifndef __STRICT_ANSI__ |