Debian Codegraph @

libstdc++-v3/src/c++23/std.compat.cc.in

raw
1 // -*- C++ -*- [std.modules] module std.compat
2
3 // Copyright The GNU Toolchain Authors.
4 //
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3.
9
10 // This 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
13 // GNU General Public License for more details.
14
15 // Under Section 7 of GPL version 3, you are granted additional
16 // permissions described in the GCC Runtime Library Exception, version
17 // 3.1, as published by the Free Software Foundation.
18
19 // You should have received a copy of the GNU General Public License and
20 // a copy of the GCC Runtime Library Exception along with this program;
21 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
22 // <http://www.gnu.org/licenses/>.
23
24 module;
25
26 #include <stdbit.h>
27 #include <stdckdint.h>
28
29 export module std.compat;
30 export import std;
31
32 #ifdef __STDC_VERSION_STDBIT_H__
33 // <stdbit.h>
34 export
35 {
36 #define _GLIBCXX_STDBIT_FUNC(F) \
37 using __gnu_cxx::F ## _uc; \
38 using __gnu_cxx::F ## _us; \
39 using __gnu_cxx::F ## _ui; \
40 using __gnu_cxx::F ## _ul; \
41 using __gnu_cxx::F ## _ull; \
42 using __gnu_cxx::F
43 _GLIBCXX_STDBIT_FUNC(stdc_leading_zeros);
44 _GLIBCXX_STDBIT_FUNC(stdc_leading_ones);
45 _GLIBCXX_STDBIT_FUNC(stdc_trailing_zeros);
46 _GLIBCXX_STDBIT_FUNC(stdc_trailing_ones);
47 _GLIBCXX_STDBIT_FUNC(stdc_first_leading_zero);
48 _GLIBCXX_STDBIT_FUNC(stdc_first_leading_one);
49 _GLIBCXX_STDBIT_FUNC(stdc_first_trailing_zero);
50 _GLIBCXX_STDBIT_FUNC(stdc_first_trailing_one);
51 _GLIBCXX_STDBIT_FUNC(stdc_count_zeros);
52 _GLIBCXX_STDBIT_FUNC(stdc_count_ones);
53 _GLIBCXX_STDBIT_FUNC(stdc_has_single_bit);
54 _GLIBCXX_STDBIT_FUNC(stdc_bit_width);
55 _GLIBCXX_STDBIT_FUNC(stdc_bit_floor);
56 _GLIBCXX_STDBIT_FUNC(stdc_bit_ceil);
57 #undef _GLIBCXX_STDBIT_FUNC
58 }
59 #endif
60
61 #ifdef __STDC_VERSION_STDCKDINT_H__
62 // <stdckdint.h>
63 export
64 {
65 using __gnu_cxx::ckd_add;
66 using __gnu_cxx::ckd_sub;
67 using __gnu_cxx::ckd_mul;
68 }
69 #endif
70
71 #define STD_COMPAT 1
72
73 // C library exports are appended from std-clib.cc.in.