summaryrefslogtreecommitdiffstats
path: root/newlib/libc
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc')
-rw-r--r--newlib/libc/include/search.h11
-rw-r--r--newlib/libc/include/stdlib.h9
2 files changed, 15 insertions, 5 deletions
diff --git a/newlib/libc/include/search.h b/newlib/libc/include/search.h
index c78ce1841..db2c48f5b 100644
--- a/newlib/libc/include/search.h
+++ b/newlib/libc/include/search.h
@@ -42,6 +42,11 @@ struct hsearch_data
size_t htablesize;
};
+#ifndef __compar_fn_t_defined
+#define __compar_fn_t_defined
+typedef int (*__compar_fn_t) (const void *, const void *);
+#endif
+
__BEGIN_DECLS
int hcreate(size_t);
void hdestroy(void);
@@ -49,10 +54,10 @@ ENTRY *hsearch(ENTRY, ACTION);
int hcreate_r(size_t, struct hsearch_data *);
void hdestroy_r(struct hsearch_data *);
int hsearch_r(ENTRY, ACTION, ENTRY **, struct hsearch_data *);
-void *tdelete(const void *, void **, int (*)(const void *, const void *));
+void *tdelete(const void *, void **, __compar_fn_t);
void tdestroy (void *, void (*)(void *));
-void *tfind(const void *, void **, int (*)(const void *, const void *));
-void *tsearch(const void *, void **, int (*)(const void *, const void *));
+void *tfind(const void *, void **, __compar_fn_t);
+void *tsearch(const void *, void **, __compar_fn_t);
void twalk(const void *, void (*)(const void *, VISIT, int));
__END_DECLS
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__