makedev.c 863 B

12345678910111213141516171819202122232425262728293031
  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. /* We do not include libbb.h - #define makedev() is there! */
  9. #include "platform.h"
  10. /* Different Unixes want different headers for makedev */
  11. #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) \
  12. || defined(__APPLE__)
  13. # include <sys/types.h>
  14. #else
  15. # include <features.h>
  16. # include <sys/sysmacros.h>
  17. #endif
  18. #ifdef __GLIBC__
  19. /* At least glibc has horrendously large inline for this, so wrap it. */
  20. /* uclibc people please check - do we need "&& !__UCLIBC__" above? */
  21. /* Suppress gcc "no previous prototype" warning */
  22. unsigned long long FAST_FUNC bb_makedev(unsigned major, unsigned minor);
  23. unsigned long long FAST_FUNC bb_makedev(unsigned major, unsigned minor)
  24. {
  25. return makedev(major, minor);
  26. }
  27. #endif