From 98a61418e9b43fc56bf3c7bffc4238debf3fc4c7 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Fri, 23 Mar 2012 13:28:16 +0000 Subject: Standardise preprocessor symbol to detect MINGW32 build --- coreutils/od_bloaty.c | 2 +- libbb/safe_gethostname.c | 13 +++---------- 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; # define LDBL_DIG DBL_DIG #endif -#ifdef __MINGW32__ +#if ENABLE_PLATFORM_MINGW32 /* symbol conflict */ #define CHAR SIZE_CHAR #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 @@ */ #include "libbb.h" -#if defined(__linux__) +#if !ENABLE_PLATFORM_MINGW32 #include #endif @@ -37,7 +37,7 @@ */ char* FAST_FUNC safe_gethostname(void) { -#if defined(__linux__) +#if !ENABLE_PLATFORM_MINGW32 struct utsname uts; /* The length of the arrays in a struct utsname is unspecified; @@ -69,19 +69,12 @@ char* FAST_FUNC safe_gethostname(void) */ char* FAST_FUNC safe_getdomainname(void) { -#if defined(__linux__) +#if !ENABLE_PLATFORM_MINGW32 /* The field domainname of struct utsname is Linux specific. */ struct utsname uts; uname(&uts); return xstrndup(!uts.domainname[0] ? "?" : uts.domainname, sizeof(uts.domainname)); #else - /* We really don't care about people with domain names wider than most screens */ - /* - char buf[256]; - int r = getdomainname(buf, sizeof(buf)); - buf[sizeof(buf)-1] = '\0'; - return xstrdup(r < 0 ? "?" : buf); - */ return xstrdup("?"); #endif } 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 @@ #define JOBS ENABLE_ASH_JOB_CONTROL #include "busybox.h" /* for applet_names */ -#ifndef __MINGW32__ +#if !ENABLE_PLATFORM_MINGW32 #include #endif #include -- cgit v1.2.3-55-g6feb