diff options
-rw-r--r-- | include/libbb.h | 2 | ||||
-rw-r--r-- | libbb/makedev.c | 19 |
2 files changed, 11 insertions, 10 deletions
diff --git a/include/libbb.h b/include/libbb.h index e5988236d..968bdcf5a 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -1297,7 +1297,7 @@ void add_to_ino_dev_hashtable(const struct stat *statbuf, const char *name) FAST | |||
1297 | void reset_ino_dev_hashtable(void) FAST_FUNC; | 1297 | void reset_ino_dev_hashtable(void) FAST_FUNC; |
1298 | #ifdef __GLIBC__ | 1298 | #ifdef __GLIBC__ |
1299 | /* At least glibc has horrendously large inline for this, so wrap it */ | 1299 | /* At least glibc has horrendously large inline for this, so wrap it */ |
1300 | unsigned long long bb_makedev(unsigned int major, unsigned int minor) FAST_FUNC; | 1300 | unsigned long long bb_makedev(unsigned major, unsigned minor) FAST_FUNC; |
1301 | #undef makedev | 1301 | #undef makedev |
1302 | #define makedev(a,b) bb_makedev(a,b) | 1302 | #define makedev(a,b) bb_makedev(a,b) |
1303 | #endif | 1303 | #endif |
diff --git a/libbb/makedev.c b/libbb/makedev.c index 1809fda4e..06c4039a3 100644 --- a/libbb/makedev.c +++ b/libbb/makedev.c | |||
@@ -8,22 +8,23 @@ | |||
8 | 8 | ||
9 | /* We do not include libbb.h - #define makedev() is there! */ | 9 | /* We do not include libbb.h - #define makedev() is there! */ |
10 | #include "platform.h" | 10 | #include "platform.h" |
11 | #if !(defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) \ | 11 | |
12 | || defined(__APPLE__) \ | 12 | /* Different Unixes want different headers for makedev */ |
13 | ) | 13 | #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) \ |
14 | || defined(__APPLE__) | ||
15 | # include <sys/types.h> | ||
16 | #else | ||
14 | # include <features.h> | 17 | # include <features.h> |
15 | # include <sys/sysmacros.h> | 18 | # include <sys/sysmacros.h> |
16 | #else | ||
17 | # include <sys/types.h> | ||
18 | #endif | 19 | #endif |
19 | 20 | ||
20 | #ifdef __GLIBC__ | 21 | #ifdef __GLIBC__ |
21 | /* At least glibc has horrendously large inline for this, so wrap it */ | 22 | /* At least glibc has horrendously large inline for this, so wrap it. */ |
22 | /* uclibc people please check - do we need "&& !__UCLIBC__" above? */ | 23 | /* uclibc people please check - do we need "&& !__UCLIBC__" above? */ |
23 | 24 | ||
24 | /* suppress gcc "no previous prototype" warning */ | 25 | /* Suppress gcc "no previous prototype" warning */ |
25 | unsigned long long FAST_FUNC bb_makedev(unsigned int major, unsigned int minor); | 26 | unsigned long long FAST_FUNC bb_makedev(unsigned major, unsigned minor); |
26 | unsigned long long FAST_FUNC bb_makedev(unsigned int major, unsigned int minor) | 27 | unsigned long long FAST_FUNC bb_makedev(unsigned major, unsigned minor) |
27 | { | 28 | { |
28 | return makedev(major, minor); | 29 | return makedev(major, minor); |
29 | } | 30 | } |