blob: 06c4039a3119e40f04bb9072018a98717fdb7c5c [file] [log] [blame]
Denis Vlasenko8023d7d2006-11-24 15:06:28 +00001/*
2 * Utility routines.
3 *
Denis Vlasenkod18f52b2008-03-02 12:53:15 +00004 * Copyright (C) 2006 Denys Vlasenko
Denis Vlasenko8023d7d2006-11-24 15:06:28 +00005 *
Denys Vlasenko0ef64bd2010-08-16 20:14:46 +02006 * Licensed under GPLv2, see file LICENSE in this source tree.
Denis Vlasenko8023d7d2006-11-24 15:06:28 +00007 */
8
9/* We do not include libbb.h - #define makedev() is there! */
Denis Vlasenko9579d872008-06-28 04:58:55 +000010#include "platform.h"
Denys Vlasenko975c7142011-01-24 23:53:12 +010011
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 Reese22af942011-01-24 17:07:40 +010017# include <features.h>
18# include <sys/sysmacros.h>
Chris Reese22af942011-01-24 17:07:40 +010019#endif
Denis Vlasenko8023d7d2006-11-24 15:06:28 +000020
21#ifdef __GLIBC__
Denys Vlasenko975c7142011-01-24 23:53:12 +010022/* At least glibc has horrendously large inline for this, so wrap it. */
Denis Vlasenko8023d7d2006-11-24 15:06:28 +000023/* uclibc people please check - do we need "&& !__UCLIBC__" above? */
Denis Vlasenko769d1e02007-01-22 23:04:27 +000024
Denys Vlasenko975c7142011-01-24 23:53:12 +010025/* Suppress gcc "no previous prototype" warning */
26unsigned long long FAST_FUNC bb_makedev(unsigned major, unsigned minor);
27unsigned long long FAST_FUNC bb_makedev(unsigned major, unsigned minor)
Denis Vlasenko8023d7d2006-11-24 15:06:28 +000028{
29 return makedev(major, minor);
30}
31#endif