diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2009-04-22 22:13:17 +1000 |
---|---|---|
committer | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2009-04-23 04:44:33 +1000 |
commit | 251687097b60bad7a88de930576b7177f34fa975 (patch) | |
tree | 79e04bf5487a27e1915f29778f6bff577a3a223b /include/platform.h | |
parent | d791e72dc28009f36da26703fc007e40cfa79414 (diff) | |
download | busybox-w32-251687097b60bad7a88de930576b7177f34fa975.tar.gz busybox-w32-251687097b60bad7a88de930576b7177f34fa975.tar.bz2 busybox-w32-251687097b60bad7a88de930576b7177f34fa975.zip |
adapt it to be buildable
Diffstat (limited to 'include/platform.h')
-rw-r--r-- | include/platform.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/include/platform.h b/include/platform.h index c2013b39d..af6a79e99 100644 --- a/include/platform.h +++ b/include/platform.h | |||
@@ -91,6 +91,11 @@ | |||
91 | 91 | ||
92 | /* ---- Endian Detection ------------------------------------ */ | 92 | /* ---- Endian Detection ------------------------------------ */ |
93 | 93 | ||
94 | #if defined __MINGW32__ | ||
95 | # define BB_BIG_ENDIAN 0 | ||
96 | # define BB_LITTLE_ENDIAN 1 | ||
97 | # define __BIG_ENDIAN__ 0 | ||
98 | #else | ||
94 | #if (defined __digital__ && defined __unix__) | 99 | #if (defined __digital__ && defined __unix__) |
95 | # include <sex.h> | 100 | # include <sex.h> |
96 | # define __BIG_ENDIAN__ (BYTE_ORDER == BIG_ENDIAN) | 101 | # define __BIG_ENDIAN__ (BYTE_ORDER == BIG_ENDIAN) |
@@ -110,6 +115,7 @@ | |||
110 | # define BB_BIG_ENDIAN 0 | 115 | # define BB_BIG_ENDIAN 0 |
111 | # define BB_LITTLE_ENDIAN 1 | 116 | # define BB_LITTLE_ENDIAN 1 |
112 | #endif | 117 | #endif |
118 | #endif | ||
113 | 119 | ||
114 | #if BB_BIG_ENDIAN | 120 | #if BB_BIG_ENDIAN |
115 | #define SWAP_BE16(x) (x) | 121 | #define SWAP_BE16(x) (x) |
@@ -128,11 +134,15 @@ | |||
128 | #endif | 134 | #endif |
129 | 135 | ||
130 | /* ---- Networking ------------------------------------------ */ | 136 | /* ---- Networking ------------------------------------------ */ |
137 | #ifdef __MINGW32__ | ||
138 | # include <winsock2.h> | ||
139 | #else | ||
131 | #ifndef __APPLE__ | 140 | #ifndef __APPLE__ |
132 | # include <arpa/inet.h> | 141 | # include <arpa/inet.h> |
133 | #else | 142 | #else |
134 | # include <netinet/in.h> | 143 | # include <netinet/in.h> |
135 | #endif | 144 | #endif |
145 | #endif | ||
136 | 146 | ||
137 | #ifndef __socklen_t_defined | 147 | #ifndef __socklen_t_defined |
138 | typedef int socklen_t; | 148 | typedef int socklen_t; |
@@ -237,7 +247,7 @@ typedef unsigned smalluint; | |||
237 | #define fdprintf dprintf | 247 | #define fdprintf dprintf |
238 | #endif | 248 | #endif |
239 | 249 | ||
240 | #if defined(__dietlibc__) | 250 | #if defined(__dietlibc__) || defined(__MINGW32__) |
241 | static ATTRIBUTE_ALWAYS_INLINE char* strchrnul(const char *s, char c) | 251 | static ATTRIBUTE_ALWAYS_INLINE char* strchrnul(const char *s, char c) |
242 | { | 252 | { |
243 | while (*s && *s != c) ++s; | 253 | while (*s && *s != c) ++s; |
@@ -253,7 +263,7 @@ static ATTRIBUTE_ALWAYS_INLINE char* strchrnul(const char *s, char c) | |||
253 | 263 | ||
254 | /* THIS SHOULD BE CLEANED OUT OF THE TREE ENTIRELY */ | 264 | /* THIS SHOULD BE CLEANED OUT OF THE TREE ENTIRELY */ |
255 | /* FIXME: fix tar.c! */ | 265 | /* FIXME: fix tar.c! */ |
256 | #ifndef FNM_LEADING_DIR | 266 | #if !defined(FNM_LEADING_DIR) && !defined(__MINGW32__) |
257 | #define FNM_LEADING_DIR 0 | 267 | #define FNM_LEADING_DIR 0 |
258 | #endif | 268 | #endif |
259 | 269 | ||