aboutsummaryrefslogtreecommitdiff
path: root/include/libbb.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libbb.h')
-rw-r--r--include/libbb.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 2f67c7f72..58a5968c5 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -75,6 +75,11 @@
75# include <arpa/inet.h> 75# include <arpa/inet.h>
76#elif defined __APPLE__ 76#elif defined __APPLE__
77# include <netinet/in.h> 77# include <netinet/in.h>
78#elif ENABLE_PLATFORM_MINGW32
79# define WINVER 0x0501
80# include <winsock2.h>
81# include <ws2tcpip.h>
82# undef s_addr
78#else 83#else
79# include <arpa/inet.h> 84# include <arpa/inet.h>
80# if !defined(__socklen_t_defined) && !defined(_SOCKLEN_T_DECLARED) 85# if !defined(__socklen_t_defined) && !defined(_SOCKLEN_T_DECLARED)
@@ -90,7 +95,9 @@
90 95
91/* Some libc's forget to declare these, do it ourself */ 96/* Some libc's forget to declare these, do it ourself */
92 97
98#if !ENABLE_PLATFORM_MINGW32
93extern char **environ; 99extern char **environ;
100#endif
94#if defined(__GLIBC__) && __GLIBC__ < 2 101#if defined(__GLIBC__) && __GLIBC__ < 2
95int vdprintf(int d, const char *format, va_list ap); 102int vdprintf(int d, const char *format, va_list ap);
96#endif 103#endif
@@ -128,6 +135,10 @@ int sysinfo(struct sysinfo* info);
128# define BUFSIZ 4096 135# define BUFSIZ 4096
129#endif 136#endif
130 137
138/* Can't use ENABLE_PLATFORM_MINGW32 because it's also called by host compiler */
139#if ENABLE_PLATFORM_MINGW32
140# include "mingw.h"
141#endif
131 142
132/* Make all declarations hidden (-fvisibility flag only affects definitions) */ 143/* Make all declarations hidden (-fvisibility flag only affects definitions) */
133/* (don't include system headers after this until corresponding pop!) */ 144/* (don't include system headers after this until corresponding pop!) */
@@ -470,6 +481,7 @@ void xlisten(int s, int backlog) FAST_FUNC;
470void xconnect(int s, const struct sockaddr *s_addr, socklen_t addrlen) FAST_FUNC; 481void xconnect(int s, const struct sockaddr *s_addr, socklen_t addrlen) FAST_FUNC;
471ssize_t xsendto(int s, const void *buf, size_t len, const struct sockaddr *to, 482ssize_t xsendto(int s, const void *buf, size_t len, const struct sockaddr *to,
472 socklen_t tolen) FAST_FUNC; 483 socklen_t tolen) FAST_FUNC;
484#if !ENABLE_PLATFORM_MINGW32
473/* SO_REUSEADDR allows a server to rebind to an address that is already 485/* SO_REUSEADDR allows a server to rebind to an address that is already
474 * "in use" by old connections to e.g. previous server instance which is 486 * "in use" by old connections to e.g. previous server instance which is
475 * killed or crashed. Without it bind will fail until all such connections 487 * killed or crashed. Without it bind will fail until all such connections
@@ -582,6 +594,7 @@ ssize_t recv_from_to(int fd, void *buf, size_t len, int flags,
582 struct sockaddr *from, 594 struct sockaddr *from,
583 struct sockaddr *to, 595 struct sockaddr *to,
584 socklen_t sa_size) FAST_FUNC; 596 socklen_t sa_size) FAST_FUNC;
597#endif
585 598
586 599
587char *xstrdup(const char *s) FAST_FUNC RETURNS_MALLOC; 600char *xstrdup(const char *s) FAST_FUNC RETURNS_MALLOC;
@@ -729,6 +742,9 @@ char *safe_getdomainname(void) FAST_FUNC;
729char* str_tolower(char *str) FAST_FUNC; 742char* str_tolower(char *str) FAST_FUNC;
730 743
731char *utoa(unsigned n) FAST_FUNC; 744char *utoa(unsigned n) FAST_FUNC;
745#if ENABLE_PLATFORM_MINGW32
746# define itoa bb_itoa
747#endif
732char *itoa(int n) FAST_FUNC; 748char *itoa(int n) FAST_FUNC;
733/* Returns a pointer past the formatted number, does NOT null-terminate */ 749/* Returns a pointer past the formatted number, does NOT null-terminate */
734char *utoa_to_buf(unsigned n, char *buf, unsigned buflen) FAST_FUNC; 750char *utoa_to_buf(unsigned n, char *buf, unsigned buflen) FAST_FUNC;
@@ -1555,7 +1571,11 @@ extern const char bb_path_group_file[];
1555extern const char bb_path_motd_file[]; 1571extern const char bb_path_motd_file[];
1556extern const char bb_path_wtmp_file[]; 1572extern const char bb_path_wtmp_file[];
1557extern const char bb_dev_null[]; 1573extern const char bb_dev_null[];
1574#if ENABLE_PLATFORM_MINGW32
1575#define bb_busybox_exec_path get_busybox_exec_path()
1576#else
1558extern const char bb_busybox_exec_path[]; 1577extern const char bb_busybox_exec_path[];
1578#endif
1559/* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin, 1579/* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin,
1560 * but I want to save a few bytes here */ 1580 * but I want to save a few bytes here */
1561extern const char bb_PATH_root_path[]; /* "PATH=/sbin:/usr/sbin:/bin:/usr/bin" */ 1581extern const char bb_PATH_root_path[]; /* "PATH=/sbin:/usr/sbin:/bin:/usr/bin" */