Silence a warning with GCC that was breaking the build with Juniper's GCC.

Reviewed by:	marcel
This commit is contained in:
David Chisnall 2014-04-05 08:17:48 +00:00
parent 09adfca39f
commit c8aeb6b447
3 changed files with 7 additions and 4 deletions

View File

@ -80,6 +80,7 @@ struct atexit {
}; };
static struct atexit *__atexit; /* points to head of LIFO stack */ static struct atexit *__atexit; /* points to head of LIFO stack */
typedef DECLARE_BLOCK(void, atexit_block, void);
/* /*
* Register the function described by 'fptr' to be called at application * Register the function described by 'fptr' to be called at application
@ -141,7 +142,7 @@ atexit(void (*func)(void))
* Register a block to be performed at exit. * Register a block to be performed at exit.
*/ */
int int
atexit_b(DECLARE_BLOCK(void, func, void)) atexit_b(atexit_block func)
{ {
struct atexit_fn fn; struct atexit_fn fn;
int error; int error;

View File

@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
#ifdef I_AM_HEAPSORT_B #ifdef I_AM_HEAPSORT_B
#include "block_abi.h" #include "block_abi.h"
#define COMPAR(x, y) CALL_BLOCK(compar, x, y) #define COMPAR(x, y) CALL_BLOCK(compar, x, y)
typedef DECLARE_BLOCK(int, heapsort_block, const void *, const void *);
#else #else
#define COMPAR(x, y) compar(x, y) #define COMPAR(x, y) compar(x, y)
#endif #endif
@ -149,7 +150,7 @@ int
heapsort_b(vbase, nmemb, size, compar) heapsort_b(vbase, nmemb, size, compar)
void *vbase; void *vbase;
size_t nmemb, size; size_t nmemb, size;
DECLARE_BLOCK(int, compar, const void *, const void *); heapsort_block compar;
#else #else
int int
heapsort(vbase, nmemb, size, compar) heapsort(vbase, nmemb, size, compar)

View File

@ -8,9 +8,10 @@
#define I_AM_QSORT_R #define I_AM_QSORT_R
#include "qsort.c" #include "qsort.c"
typedef DECLARE_BLOCK(int, qsort_block, const void *, const void *);
void void
qsort_b(void *base, size_t nel, size_t width, qsort_b(void *base, size_t nel, size_t width, qsort_block compar)
DECLARE_BLOCK(int, compar, const void *, const void *))
{ {
qsort_r(base, nel, width, compar, qsort_r(base, nel, width, compar,
(int (*)(void *, const void *, const void *)) (int (*)(void *, const void *, const void *))