Fix compiling errors of tools.

dev
logwang 2017-09-05 14:30:42 +08:00
parent 7787718ee8
commit 1f5381c9ea
4 changed files with 13 additions and 5 deletions

View File

@ -37,10 +37,6 @@
#define __dead __dead2
#endif
#ifndef __unused
#define __unused __attribute__((__unused__))
#endif
#ifndef nitems
#define nitems(x) (sizeof((x)) / sizeof((x)[0]))
#endif

View File

@ -31,6 +31,12 @@ __FBSDID("$FreeBSD$");
#include <stdlib.h>
#include <unistd.h>
#ifdef FSTACK
#ifndef __unused
#define __unused __attribute__((__unused__))
#endif
#endif
/*
* Stub out what's in -lcrypt.
*/

View File

@ -13,7 +13,7 @@ CLEANFILES+= nl_symbols.c nl_defs.h
CFLAGS+= -I${TOPDIR}/tools/libutil
CFLAGS+= -I${TOPDIR}/tools/libmemstat
CFLAGS+= -I${TOPDIR}/tools/libxo/libxo
CFLAGS+= -I${TOPDIR}/tools/libxo
LIBS+= -L${TOPDIR}/tools/libutil -lutil
LIBS+= -L${TOPDIR}/tools/libmemstat -lmemstat

View File

@ -32,6 +32,12 @@
#include <sys/cdefs.h>
#ifdef FSTACK
#ifndef __unused
#define __unused __attribute__((__unused__))
#endif
#endif
#define satosin(sa) ((struct sockaddr_in *)(sa))
#define satosin6(sa) ((struct sockaddr_in6 *)(sa))
#define sin6tosa(sin6) ((struct sockaddr *)(sin6))