s390: Improve static-pie configure tests
[glibc.git] / misc / sys / sysmacros.h
blob9823b89d3e470e1d12d2c88d7def4ed1bb142430
1 /* Definitions of macros to access `dev_t' values.
2 Copyright (C) 1996-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
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.
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.
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/>. */
19 #ifndef _SYS_SYSMACROS_H
20 #define _SYS_SYSMACROS_H 1
22 #include <features.h>
23 #include <bits/types.h>
24 #include <bits/sysmacros.h>
26 #define __SYSMACROS_DECL_TEMPL(rtype, name, proto) \
27 extern rtype gnu_dev_##name proto __THROW __attribute_const__;
29 #define __SYSMACROS_IMPL_TEMPL(rtype, name, proto) \
30 __extension__ __extern_inline __attribute_const__ rtype \
31 __NTH (gnu_dev_##name proto)
33 __BEGIN_DECLS
35 __SYSMACROS_DECLARE_MAJOR (__SYSMACROS_DECL_TEMPL)
36 __SYSMACROS_DECLARE_MINOR (__SYSMACROS_DECL_TEMPL)
37 __SYSMACROS_DECLARE_MAKEDEV (__SYSMACROS_DECL_TEMPL)
39 #ifdef __USE_EXTERN_INLINES
41 __SYSMACROS_DEFINE_MAJOR (__SYSMACROS_IMPL_TEMPL)
42 __SYSMACROS_DEFINE_MINOR (__SYSMACROS_IMPL_TEMPL)
43 __SYSMACROS_DEFINE_MAKEDEV (__SYSMACROS_IMPL_TEMPL)
45 #endif
47 __END_DECLS
49 #ifndef __SYSMACROS_NEED_IMPLEMENTATION
50 # undef __SYSMACROS_DECL_TEMPL
51 # undef __SYSMACROS_IMPL_TEMPL
52 # undef __SYSMACROS_DECLARE_MAJOR
53 # undef __SYSMACROS_DECLARE_MINOR
54 # undef __SYSMACROS_DECLARE_MAKEDEV
55 # undef __SYSMACROS_DEFINE_MAJOR
56 # undef __SYSMACROS_DEFINE_MINOR
57 # undef __SYSMACROS_DEFINE_MAKEDEV
58 #endif
60 #define major(dev) gnu_dev_major (dev)
61 #define minor(dev) gnu_dev_minor (dev)
62 #define makedev(maj, min) gnu_dev_makedev (maj, min)
64 #endif /* sys/sysmacros.h */