Denis Vlasenko | 8023d7d | 2006-11-24 15:06:28 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Utility routines. |
| 3 | * |
Denis Vlasenko | d18f52b | 2008-03-02 12:53:15 +0000 | [diff] [blame] | 4 | * Copyright (C) 2006 Denys Vlasenko |
Denis Vlasenko | 8023d7d | 2006-11-24 15:06:28 +0000 | [diff] [blame] | 5 | * |
Denys Vlasenko | 0ef64bd | 2010-08-16 20:14:46 +0200 | [diff] [blame] | 6 | * Licensed under GPLv2, see file LICENSE in this source tree. |
Denis Vlasenko | 8023d7d | 2006-11-24 15:06:28 +0000 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | /* We do not include libbb.h - #define makedev() is there! */ |
Denis Vlasenko | 9579d87 | 2008-06-28 04:58:55 +0000 | [diff] [blame] | 10 | #include "platform.h" |
Denys Vlasenko | 975c714 | 2011-01-24 23:53:12 +0100 | [diff] [blame] | 11 | |
| 12 | /* Different Unixes want different headers for makedev */ |
| 13 | #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) \ |
| 14 | || defined(__APPLE__) |
| 15 | # include <sys/types.h> |
| 16 | #else |
Chris Rees | e22af94 | 2011-01-24 17:07:40 +0100 | [diff] [blame] | 17 | # include <features.h> |
| 18 | # include <sys/sysmacros.h> |
Chris Rees | e22af94 | 2011-01-24 17:07:40 +0100 | [diff] [blame] | 19 | #endif |
Denis Vlasenko | 8023d7d | 2006-11-24 15:06:28 +0000 | [diff] [blame] | 20 | |
| 21 | #ifdef __GLIBC__ |
Denys Vlasenko | 975c714 | 2011-01-24 23:53:12 +0100 | [diff] [blame] | 22 | /* At least glibc has horrendously large inline for this, so wrap it. */ |
Denis Vlasenko | 8023d7d | 2006-11-24 15:06:28 +0000 | [diff] [blame] | 23 | /* uclibc people please check - do we need "&& !__UCLIBC__" above? */ |
Denis Vlasenko | 769d1e0 | 2007-01-22 23:04:27 +0000 | [diff] [blame] | 24 | |
Denys Vlasenko | 975c714 | 2011-01-24 23:53:12 +0100 | [diff] [blame] | 25 | /* Suppress gcc "no previous prototype" warning */ |
| 26 | unsigned long long FAST_FUNC bb_makedev(unsigned major, unsigned minor); |
| 27 | unsigned long long FAST_FUNC bb_makedev(unsigned major, unsigned minor) |
Denis Vlasenko | 8023d7d | 2006-11-24 15:06:28 +0000 | [diff] [blame] | 28 | { |
| 29 | return makedev(major, minor); |
| 30 | } |
| 31 | #endif |