summaryrefslogtreecommitdiff
path: root/libbb/makedev.c (plain)
blob: 06c4039a3119e40f04bb9072018a98717fdb7c5c
1/*
2 * Utility routines.
3 *
4 * Copyright (C) 2006 Denys Vlasenko
5 *
6 * Licensed under GPLv2, see file LICENSE in this source tree.
7 */
8
9/* We do not include libbb.h - #define makedev() is there! */
10#include "platform.h"
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
17# include <features.h>
18# include <sys/sysmacros.h>
19#endif
20
21#ifdef __GLIBC__
22/* At least glibc has horrendously large inline for this, so wrap it. */
23/* uclibc people please check - do we need "&& !__UCLIBC__" above? */
24
25/* 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)
28{
29 return makedev(major, minor);
30}
31#endif
32