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

source code of glibc/include/sys/sysmacros.h