Skip to content

Commit

Permalink
Fix compiling errors of tools.
Browse files Browse the repository at this point in the history
  • Loading branch information
logwang committed Sep 5, 2017
1 parent 7787718 commit 1f5381c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
4 changes: 0 additions & 4 deletions tools/compat/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions tools/libutil/stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
2 changes: 1 addition & 1 deletion tools/netstat/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions tools/netstat/netstat.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 1f5381c

Please sign in to comment.