sysmacros.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* Definitions of macros to access 'dev_t' values. Internal header.
  2. Copyright (C) 2018-2026 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <https://www.gnu.org/licenses/>. */
  15. #ifndef _ISOMAC
  16. # define __SYSMACROS_NEED_IMPLEMENTATION
  17. #endif
  18. #include <misc/sys/sysmacros.h>
  19. #if !defined _SYS_SYSMACROS_H_WRAPPER && !defined _ISOMAC
  20. # define _SYS_SYSMACROS_H_WRAPPER 1
  21. libc_hidden_proto (gnu_dev_major)
  22. libc_hidden_proto (gnu_dev_minor)
  23. libc_hidden_proto (gnu_dev_makedev)
  24. # undef __SYSMACROS_DECL_TEMPL
  25. # define __SYSMACROS_DECL_TEMPL(rtype, name, proto) \
  26. extern rtype __gnu_dev_##name proto \
  27. __THROW __attribute_const__ attribute_hidden;
  28. # undef __SYSMACROS_IMPL_TEMPL
  29. # define __SYSMACROS_IMPL_TEMPL(rtype, name, proto) \
  30. __extension__ __extern_inline __attribute_const__ rtype \
  31. __NTH (__gnu_dev_##name proto)
  32. __SYSMACROS_DECLARE_MAJOR (__SYSMACROS_DECL_TEMPL)
  33. __SYSMACROS_DECLARE_MINOR (__SYSMACROS_DECL_TEMPL)
  34. __SYSMACROS_DECLARE_MAKEDEV (__SYSMACROS_DECL_TEMPL)
  35. # ifdef __USE_EXTERN_INLINES
  36. __SYSMACROS_DEFINE_MAJOR (__SYSMACROS_IMPL_TEMPL)
  37. __SYSMACROS_DEFINE_MINOR (__SYSMACROS_IMPL_TEMPL)
  38. __SYSMACROS_DEFINE_MAKEDEV (__SYSMACROS_IMPL_TEMPL)
  39. # endif
  40. #endif