aboutsummaryrefslogtreecommitdiff
path: root/include/libbb.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libbb.h')
-rw-r--r--include/libbb.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 6dd4d7cae..f5b7d8dc7 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -112,6 +112,13 @@
112# include <arpa/inet.h> 112# include <arpa/inet.h>
113#elif defined __APPLE__ 113#elif defined __APPLE__
114# include <netinet/in.h> 114# include <netinet/in.h>
115#elif ENABLE_PLATFORM_MINGW32
116# ifndef WINVER
117# define WINVER 0x0501
118# endif
119# include <winsock2.h>
120# include <ws2tcpip.h>
121# undef s_addr
115#else 122#else
116# include <arpa/inet.h> 123# include <arpa/inet.h>
117# if !defined(__socklen_t_defined) && !defined(_SOCKLEN_T_DECLARED) 124# if !defined(__socklen_t_defined) && !defined(_SOCKLEN_T_DECLARED)
@@ -136,7 +143,9 @@
136 143
137/* Some libc's forget to declare these, do it ourself */ 144/* Some libc's forget to declare these, do it ourself */
138 145
146#if !ENABLE_PLATFORM_MINGW32
139extern char **environ; 147extern char **environ;
148#endif
140#if defined(__GLIBC__) && __GLIBC__ < 2 149#if defined(__GLIBC__) && __GLIBC__ < 2
141int vdprintf(int d, const char *format, va_list ap); 150int vdprintf(int d, const char *format, va_list ap);
142#endif 151#endif
@@ -149,6 +158,10 @@ int klogctl(int type, char *b, int len);
149# define BUFSIZ 4096 158# define BUFSIZ 4096
150#endif 159#endif
151 160
161/* Can't use ENABLE_PLATFORM_MINGW32 because it's also called by host compiler */
162#if ENABLE_PLATFORM_MINGW32
163# include "mingw.h"
164#endif
152 165
153/* Busybox does not use threads, we can speed up stdio. */ 166/* Busybox does not use threads, we can speed up stdio. */
154#ifdef HAVE_UNLOCKED_STDIO 167#ifdef HAVE_UNLOCKED_STDIO
@@ -803,6 +816,9 @@ char *safe_gethostname(void) FAST_FUNC;
803char* str_tolower(char *str) FAST_FUNC; 816char* str_tolower(char *str) FAST_FUNC;
804 817
805char *utoa(unsigned n) FAST_FUNC; 818char *utoa(unsigned n) FAST_FUNC;
819#if ENABLE_PLATFORM_MINGW32
820# define itoa bb_itoa
821#endif
806char *itoa(int n) FAST_FUNC; 822char *itoa(int n) FAST_FUNC;
807/* Returns a pointer past the formatted number, does NOT null-terminate */ 823/* Returns a pointer past the formatted number, does NOT null-terminate */
808char *utoa_to_buf(unsigned n, char *buf, unsigned buflen) FAST_FUNC; 824char *utoa_to_buf(unsigned n, char *buf, unsigned buflen) FAST_FUNC;
@@ -1560,6 +1576,9 @@ typedef struct procps_status_t {
1560#if ENABLE_FEATURE_TOP_SMP_PROCESS 1576#if ENABLE_FEATURE_TOP_SMP_PROCESS
1561 int last_seen_on_cpu; 1577 int last_seen_on_cpu;
1562#endif 1578#endif
1579#if ENABLE_PLATFORM_MINGW32
1580 HANDLE snapshot;
1581#endif
1563} procps_status_t; 1582} procps_status_t;
1564/* flag bits for procps_scan(xx, flags) calls */ 1583/* flag bits for procps_scan(xx, flags) calls */
1565enum { 1584enum {
@@ -1734,7 +1753,11 @@ extern const char bb_path_wtmp_file[] ALIGN1;
1734#define bb_path_motd_file "/etc/motd" 1753#define bb_path_motd_file "/etc/motd"
1735 1754
1736#define bb_dev_null "/dev/null" 1755#define bb_dev_null "/dev/null"
1756#if ENABLE_PLATFORM_MINGW32
1757#define bb_busybox_exec_path get_busybox_exec_path()
1758#else
1737extern const char bb_busybox_exec_path[] ALIGN1; 1759extern const char bb_busybox_exec_path[] ALIGN1;
1760#endif
1738/* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin, 1761/* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin,
1739 * but I want to save a few bytes here */ 1762 * but I want to save a few bytes here */
1740extern const char bb_PATH_root_path[] ALIGN1; /* "PATH=/sbin:/usr/sbin:/bin:/usr/bin" */ 1763extern const char bb_PATH_root_path[] ALIGN1; /* "PATH=/sbin:/usr/sbin:/bin:/usr/bin" */