diff options
author | Ron Yorston <rmy@pobox.com> | 2012-03-23 13:28:16 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2012-03-23 13:28:16 +0000 |
commit | 98a61418e9b43fc56bf3c7bffc4238debf3fc4c7 (patch) | |
tree | e5a7a8db492c916eddfec14f07465ab91b131098 | |
parent | 802674045737c916203521043905526b5c851c92 (diff) | |
download | busybox-w32-98a61418e9b43fc56bf3c7bffc4238debf3fc4c7.tar.gz busybox-w32-98a61418e9b43fc56bf3c7bffc4238debf3fc4c7.tar.bz2 busybox-w32-98a61418e9b43fc56bf3c7bffc4238debf3fc4c7.zip |
Standardise preprocessor symbol to detect MINGW32 build
-rw-r--r-- | coreutils/od_bloaty.c | 2 | ||||
-rw-r--r-- | libbb/safe_gethostname.c | 13 | ||||
-rw-r--r-- | shell/ash.c | 2 |
3 files changed, 5 insertions, 12 deletions
diff --git a/coreutils/od_bloaty.c b/coreutils/od_bloaty.c index 8013f483c..8497722ba 100644 --- a/coreutils/od_bloaty.c +++ b/coreutils/od_bloaty.c | |||
@@ -100,7 +100,7 @@ typedef long long llong; | |||
100 | # define LDBL_DIG DBL_DIG | 100 | # define LDBL_DIG DBL_DIG |
101 | #endif | 101 | #endif |
102 | 102 | ||
103 | #ifdef __MINGW32__ | 103 | #if ENABLE_PLATFORM_MINGW32 |
104 | /* symbol conflict */ | 104 | /* symbol conflict */ |
105 | #define CHAR SIZE_CHAR | 105 | #define CHAR SIZE_CHAR |
106 | #define SHORT SIZE_SHORT | 106 | #define SHORT SIZE_SHORT |
diff --git a/libbb/safe_gethostname.c b/libbb/safe_gethostname.c index 233a6a418..33ca2b9f3 100644 --- a/libbb/safe_gethostname.c +++ b/libbb/safe_gethostname.c | |||
@@ -25,7 +25,7 @@ | |||
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "libbb.h" | 27 | #include "libbb.h" |
28 | #if defined(__linux__) | 28 | #if !ENABLE_PLATFORM_MINGW32 |
29 | #include <sys/utsname.h> | 29 | #include <sys/utsname.h> |
30 | #endif | 30 | #endif |
31 | 31 | ||
@@ -37,7 +37,7 @@ | |||
37 | */ | 37 | */ |
38 | char* FAST_FUNC safe_gethostname(void) | 38 | char* FAST_FUNC safe_gethostname(void) |
39 | { | 39 | { |
40 | #if defined(__linux__) | 40 | #if !ENABLE_PLATFORM_MINGW32 |
41 | struct utsname uts; | 41 | struct utsname uts; |
42 | 42 | ||
43 | /* The length of the arrays in a struct utsname is unspecified; | 43 | /* The length of the arrays in a struct utsname is unspecified; |
@@ -69,19 +69,12 @@ char* FAST_FUNC safe_gethostname(void) | |||
69 | */ | 69 | */ |
70 | char* FAST_FUNC safe_getdomainname(void) | 70 | char* FAST_FUNC safe_getdomainname(void) |
71 | { | 71 | { |
72 | #if defined(__linux__) | 72 | #if !ENABLE_PLATFORM_MINGW32 |
73 | /* The field domainname of struct utsname is Linux specific. */ | 73 | /* The field domainname of struct utsname is Linux specific. */ |
74 | struct utsname uts; | 74 | struct utsname uts; |
75 | uname(&uts); | 75 | uname(&uts); |
76 | return xstrndup(!uts.domainname[0] ? "?" : uts.domainname, sizeof(uts.domainname)); | 76 | return xstrndup(!uts.domainname[0] ? "?" : uts.domainname, sizeof(uts.domainname)); |
77 | #else | 77 | #else |
78 | /* We really don't care about people with domain names wider than most screens */ | ||
79 | /* | ||
80 | char buf[256]; | ||
81 | int r = getdomainname(buf, sizeof(buf)); | ||
82 | buf[sizeof(buf)-1] = '\0'; | ||
83 | return xstrdup(r < 0 ? "?" : buf); | ||
84 | */ | ||
85 | return xstrdup("?"); | 78 | return xstrdup("?"); |
86 | #endif | 79 | #endif |
87 | } | 80 | } |
diff --git a/shell/ash.c b/shell/ash.c index 065678ea5..f8fc668c8 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -49,7 +49,7 @@ | |||
49 | #define JOBS ENABLE_ASH_JOB_CONTROL | 49 | #define JOBS ENABLE_ASH_JOB_CONTROL |
50 | 50 | ||
51 | #include "busybox.h" /* for applet_names */ | 51 | #include "busybox.h" /* for applet_names */ |
52 | #ifndef __MINGW32__ | 52 | #if !ENABLE_PLATFORM_MINGW32 |
53 | #include <paths.h> | 53 | #include <paths.h> |
54 | #endif | 54 | #endif |
55 | #include <setjmp.h> | 55 | #include <setjmp.h> |