Signed-off-by: Nguyễn Thái Ngọc Duy <pclo...@gmail.com> --- libbb/get_console.c | 4 ++++ libbb/getpty.c | 3 +++ libbb/inet_common.c | 4 ++++ libbb/kernel_version.c | 5 +++++ libbb/login.c | 5 +++++ libbb/makedev.c | 5 +++++ libbb/match_fstype.c | 4 ++++ libbb/safe_gethostname.c | 4 ++++ libbb/signals.c | 2 ++ libbb/udp_io.c | 2 ++ libbb/xconnect.c | 2 ++ libbb/xfuncs.c | 4 ++++ libbb/xfuncs_printf.c | 4 ++++ libbb/xgethostbyname.c | 4 ++++ 14 files changed, 52 insertions(+), 0 deletions(-)
diff --git a/libbb/get_console.c b/libbb/get_console.c index 74022b5..244c2dc 100644 --- a/libbb/get_console.c +++ b/libbb/get_console.c @@ -10,6 +10,8 @@ #include "libbb.h" +#if !ENABLE_TARGET_WIN32 + /* From <linux/kd.h> */ enum { KDGKBTYPE = 0x4B33 }; /* get keyboard type */ @@ -78,3 +80,5 @@ void FAST_FUNC console_make_active(int fd, const int vt_num) xioctl(fd, VT_ACTIVATE, (void *)(ptrdiff_t)vt_num); xioctl(fd, VT_WAITACTIVE, (void *)(ptrdiff_t)vt_num); } + +#endif diff --git a/libbb/getpty.c b/libbb/getpty.c index 4bffd9a..f3c7f5c 100644 --- a/libbb/getpty.c +++ b/libbb/getpty.c @@ -8,6 +8,8 @@ #include "libbb.h" +#if !ENABLE_TARGET_WIN32 + #define DEBUG 0 int FAST_FUNC xgetpty(char *line) @@ -62,3 +64,4 @@ int FAST_FUNC xgetpty(char *line) #endif /* FEATURE_DEVPTS */ bb_error_msg_and_die("can't find free pty"); } +#endif diff --git a/libbb/inet_common.c b/libbb/inet_common.c index 0fc08d6..1be21ed 100644 --- a/libbb/inet_common.c +++ b/libbb/inet_common.c @@ -11,6 +11,8 @@ #include "libbb.h" #include "inet_common.h" +#if !ENABLE_TARGET_WIN32 + int FAST_FUNC INET_resolve(const char *name, struct sockaddr_in *s_in, int hostfirst) { struct hostent *hp; @@ -219,3 +221,5 @@ char* FAST_FUNC INET6_rresolve(struct sockaddr_in6 *sin6, int numeric) } #endif /* CONFIG_FEATURE_IPV6 */ + +#endif diff --git a/libbb/kernel_version.c b/libbb/kernel_version.c index cc23712..63e3953 100644 --- a/libbb/kernel_version.c +++ b/libbb/kernel_version.c @@ -8,6 +8,9 @@ */ #include "libbb.h" + +#if !ENABLE_TARGET_WIN32 + /* After libbb.h, since it needs sys/types.h on some systems */ #include <sys/utsname.h> /* for uname(2) */ @@ -36,3 +39,5 @@ int FAST_FUNC get_linux_version_code(void) } return r; } + +#endif diff --git a/libbb/login.c b/libbb/login.c index 740c588..dfbe072 100644 --- a/libbb/login.c +++ b/libbb/login.c @@ -10,6 +10,9 @@ */ #include "libbb.h" + +#if !ENABLE_TARGET_WIN32 + /* After libbb.h, since it needs sys/types.h on some systems */ #include <sys/utsname.h> @@ -130,3 +133,5 @@ int FAST_FUNC sanitize_env_if_suid(void) return 1; /* we indeed were run by different user! */ } + +#endif diff --git a/libbb/makedev.c b/libbb/makedev.c index ca71fdb..7e5f7e2 100644 --- a/libbb/makedev.c +++ b/libbb/makedev.c @@ -8,6 +8,9 @@ /* We do not include libbb.h - #define makedev() is there! */ #include "platform.h" + +#if !ENABLE_TARGET_WIN32 + #include <features.h> #include <sys/sysmacros.h> @@ -22,3 +25,5 @@ unsigned long long FAST_FUNC bb_makedev(unsigned int major, unsigned int minor) return makedev(major, minor); } #endif + +#endif diff --git a/libbb/match_fstype.c b/libbb/match_fstype.c index 9360e75..81bee80 100644 --- a/libbb/match_fstype.c +++ b/libbb/match_fstype.c @@ -12,6 +12,8 @@ #include "libbb.h" +#if !ENABLE_TARGET_WIN32 + int FAST_FUNC match_fstype(const struct mntent *mt, const char *t_fstype) { int match = 1; @@ -40,3 +42,5 @@ int FAST_FUNC match_fstype(const struct mntent *mt, const char *t_fstype) return !match; } + +#endif diff --git a/libbb/safe_gethostname.c b/libbb/safe_gethostname.c index 05e0954..89302ef 100644 --- a/libbb/safe_gethostname.c +++ b/libbb/safe_gethostname.c @@ -25,6 +25,9 @@ */ #include "libbb.h" + +#if !ENABLE_TARGET_WIN32 + #include <sys/utsname.h> /* @@ -72,3 +75,4 @@ char* FAST_FUNC safe_getdomainname(void) return xstrdup(r < 0 ? "?" : buf); #endif } +#endif diff --git a/libbb/signals.c b/libbb/signals.c index a528756..8ca903e 100644 --- a/libbb/signals.c +++ b/libbb/signals.c @@ -11,6 +11,7 @@ #include "libbb.h" +#if !ENABLE_TARGET_WIN32 /* All known arches use small ints for signals */ smallint bb_got_signal; @@ -119,3 +120,4 @@ void FAST_FUNC signal_no_SA_RESTART_empty_mask(int sig, void (*handler)(int)) sa.sa_handler = handler; sigaction_set(sig, &sa); } +#endif diff --git a/libbb/udp_io.c b/libbb/udp_io.c index 24237be..dd98484 100644 --- a/libbb/udp_io.c +++ b/libbb/udp_io.c @@ -8,6 +8,7 @@ */ #include "libbb.h" +#if !ENABLE_TARGET_WIN32 /* * This asks kernel to let us know dst addr/port of incoming packets * We don't check for errors here. Not supported == won't be used @@ -177,3 +178,4 @@ recv_from_to(int fd, void *buf, size_t len, int flags, return recv_length; #endif } +#endif diff --git a/libbb/xconnect.c b/libbb/xconnect.c index c3ee633..2972ef3 100644 --- a/libbb/xconnect.c +++ b/libbb/xconnect.c @@ -7,6 +7,7 @@ * Licensed under GPLv2, see file LICENSE in this tarball for details. */ +#if !ENABLE_TARGET_WIN32 #include <sys/socket.h> /* netinet/in.h needs it */ #include <netinet/in.h> #include <net/if.h> @@ -478,3 +479,4 @@ char* FAST_FUNC xmalloc_sockaddr2dotted_noport(const struct sockaddr *sa) { return sockaddr2str(sa, NI_NUMERICHOST | IGNORE_PORT); } +#endif diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c index aec165f..c8a4188 100644 --- a/libbb/xfuncs.c +++ b/libbb/xfuncs.c @@ -24,6 +24,7 @@ #include "libbb.h" +#if !ENABLE_TARGET_WIN32 /* Turn on nonblocking I/O on a fd */ int FAST_FUNC ndelay_on(int fd) { @@ -39,6 +40,7 @@ int FAST_FUNC close_on_exec_on(int fd) { return fcntl(fd, F_SETFD, FD_CLOEXEC); } +#endif char* FAST_FUNC strncpy_IFNAMSIZ(char *dst, const char *src) { @@ -199,6 +201,7 @@ off_t FAST_FUNC fdlength(int fd) } #endif +#if !ENABLE_TARGET_WIN32 char* FAST_FUNC xmalloc_ttyname(int fd) { char *buf = xzalloc(128); @@ -239,6 +242,7 @@ int FAST_FUNC get_terminal_width_height(int fd, unsigned *width, unsigned *heigh return ret; } +#endif int FAST_FUNC tcsetattr_stdin_TCSANOW(const struct termios *tp) { diff --git a/libbb/xfuncs_printf.c b/libbb/xfuncs_printf.c index 7207ec5..f3a83d8 100644 --- a/libbb/xfuncs_printf.c +++ b/libbb/xfuncs_printf.c @@ -144,10 +144,12 @@ int FAST_FUNC xopen(const char *pathname, int flags) * and return the fd. * Note that for ioctl O_RDONLY is sufficient. */ +#if !ENABLE_TARGET_WIN32 int FAST_FUNC xopen_nonblocking(const char *pathname) { return xopen(pathname, O_RDONLY | O_NONBLOCK); } +#endif // Warn if we can't open a file and return a fd. int FAST_FUNC open3_or_warn(const char *pathname, int flags, int mode) @@ -442,6 +444,7 @@ void FAST_FUNC selinux_or_die(void) #endif } +#if !ENABLE_TARGET_WIN32 int FAST_FUNC ioctl_or_perror_and_die(int fd, unsigned request, void *argp, const char *fmt,...) { int ret; @@ -510,3 +513,4 @@ int FAST_FUNC bb_xioctl(int fd, unsigned request, void *argp) return ret; } #endif +#endif diff --git a/libbb/xgethostbyname.c b/libbb/xgethostbyname.c index 7afa9b6..70ee754 100644 --- a/libbb/xgethostbyname.c +++ b/libbb/xgethostbyname.c @@ -8,6 +8,8 @@ */ #include "libbb.h" +#if !ENABLE_TARGET_WIN32 + struct hostent* FAST_FUNC xgethostbyname(const char *name) { struct hostent *retval = gethostbyname(name); @@ -15,3 +17,5 @@ struct hostent* FAST_FUNC xgethostbyname(const char *name) bb_herror_msg_and_die("%s", name); return retval; } + +#endif
_______________________________________________ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox