From 0127b103f27578fc7f9cc3389b299f221deb1d4c Mon Sep 17 00:00:00 2001 From: theraven Date: Wed, 2 Apr 2014 16:07:48 +0000 Subject: Add support for some block functions that come from OS X. These are intended to build with any C compiler. Reviewed by: pfg MFC after: 3 weeks --- include/stdlib.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/stdlib.h') diff --git a/include/stdlib.h b/include/stdlib.h index 3ed07f3..4aa372b 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -82,6 +82,9 @@ extern int ___mb_cur_max(void); _Noreturn void abort(void); int abs(int) __pure2; int atexit(void (*)(void)); +#ifdef __BLOCKS__ +int atexit_b(void (^)(void)); +#endif double atof(const char *); int atoi(const char *); long atol(const char *); @@ -100,6 +103,10 @@ size_t mbstowcs(wchar_t * __restrict , const char * __restrict, size_t); int mbtowc(wchar_t * __restrict, const char * __restrict, size_t); void qsort(void *, size_t, size_t, int (*)(const void *, const void *)); +#ifdef __BLOCKS__ +void qsort_b(void *, size_t, size_t, + int (^)(const void *, const void *)); +#endif int rand(void); void *realloc(void *, size_t); void srand(unsigned); @@ -280,8 +287,14 @@ const char * getprogname(void); int heapsort(void *, size_t, size_t, int (*)(const void *, const void *)); +#ifdef __BLOCKS__ +int heapsort_b(void *, size_t, size_t, int (^)(const void *, const void *)); +#endif int l64a_r(long, char *, int); int mergesort(void *, size_t, size_t, int (*)(const void *, const void *)); +#ifdef __BLOCKS__ +int mergesort_b(void *, size_t, size_t, int (^)(const void *, const void *)); +#endif int mkostemp(char *, int); int mkostemps(char *, int, int); void qsort_r(void *, size_t, size_t, void *, -- cgit v1.1