aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-04-05 22:18:30 +0200
committerNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-04-19 18:42:37 +0200
commitedc80343818bc2d8563fa3b5ff39153a6a78ba46 (patch)
tree635a8f51f5c03d38c53428112845438e7088de94
parentcfb54305180d7ef1c0a34fee9b4e4b7a94c868bf (diff)
downloadbusybox-w32-edc80343818bc2d8563fa3b5ff39153a6a78ba46.tar.gz
busybox-w32-edc80343818bc2d8563fa3b5ff39153a6a78ba46.tar.bz2
busybox-w32-edc80343818bc2d8563fa3b5ff39153a6a78ba46.zip
platform.h: support MinGW port
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
-rw-r--r--include/platform.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/include/platform.h b/include/platform.h
index 221fbcb07..2b57e7f9e 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -7,8 +7,14 @@
7#ifndef BB_PLATFORM_H 7#ifndef BB_PLATFORM_H
8#define BB_PLATFORM_H 1 8#define BB_PLATFORM_H 1
9 9
10#if defined(__MINGW32__) && !ENABLE_PLATFORM_MINGW32 10#if ENABLE_PLATFORM_MINGW32
11# error "You must select target platform MS Windows, or it won't build" 11# if !defined(__MINGW32__) /* HOSTCC is called */
12# undef ENABLE_PLATFORM_MINGW32
13# endif
14#else
15# if defined(__MINGW32__)
16# error "You must select target platform MS Windows, or it won't build"
17# endif
12#endif 18#endif
13 19
14/* Assume all these functions exist by default. Platforms where it is not 20/* Assume all these functions exist by default. Platforms where it is not
@@ -143,7 +149,7 @@
143 149
144/* Make all declarations hidden (-fvisibility flag only affects definitions) */ 150/* Make all declarations hidden (-fvisibility flag only affects definitions) */
145/* (don't include system headers after this until corresponding pop!) */ 151/* (don't include system headers after this until corresponding pop!) */
146#if __GNUC_PREREQ(4,1) 152#if __GNUC_PREREQ(4,1) && !ENABLE_PLATFORM_MINGW32
147# define PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN _Pragma("GCC visibility push(hidden)") 153# define PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN _Pragma("GCC visibility push(hidden)")
148# define POP_SAVED_FUNCTION_VISIBILITY _Pragma("GCC visibility pop") 154# define POP_SAVED_FUNCTION_VISIBILITY _Pragma("GCC visibility pop")
149#else 155#else
@@ -233,7 +239,8 @@ typedef uint32_t bb__aliased_uint32_t FIX_ALIASING;
233/* ---- Compiler dependent settings ------------------------- */ 239/* ---- Compiler dependent settings ------------------------- */
234 240
235#if (defined __digital__ && defined __unix__) \ 241#if (defined __digital__ && defined __unix__) \
236 || defined __APPLE__ || defined __FreeBSD__ 242 || defined __APPLE__ || defined __FreeBSD__ \
243 || ENABLE_PLATFORM_MINGW32
237# undef HAVE_MNTENT_H 244# undef HAVE_MNTENT_H
238# undef HAVE_SYS_STATFS_H 245# undef HAVE_SYS_STATFS_H
239#else 246#else
@@ -350,6 +357,16 @@ typedef unsigned smalluint;
350# undef HAVE_STRCHRNUL 357# undef HAVE_STRCHRNUL
351#endif 358#endif
352 359
360#if ENABLE_PLATFORM_MINGW32
361# undef HAVE_FDPRINTF
362# undef HAVE_MKDTEMP
363# undef HAVE_SETBIT
364# undef HAVE_STRCASESTR
365# undef HAVE_STRCHRNUL
366# undef HAVE_STRSIGNAL
367# undef HAVE_VASPRINTF
368#endif
369
353#if defined(__WATCOMC__) 370#if defined(__WATCOMC__)
354# undef HAVE_FDPRINTF 371# undef HAVE_FDPRINTF
355# undef HAVE_MEMRCHR 372# undef HAVE_MEMRCHR
@@ -401,6 +418,9 @@ extern char *strchrnul(const char *s, int c) FAST_FUNC;
401#endif 418#endif
402 419
403#ifndef HAVE_VASPRINTF 420#ifndef HAVE_VASPRINTF
421# if ENABLE_PLATFORM_MINGW32
422# include <stdarg.h>
423# endif
404extern int vasprintf(char **string_ptr, const char *format, va_list p) FAST_FUNC; 424extern int vasprintf(char **string_ptr, const char *format, va_list p) FAST_FUNC;
405#endif 425#endif
406 426