17
17
#include <stdbool.h> // bool in C
18
18
19
19
#define STDBIT_STUB_FUNCTION (FUNC_NAME , LEADING_VAL ) \
20
- unsigned FUNC_NAME##_uc(unsigned char x) __NOEXCEPT { \
21
- return LEADING_VAL##AU; \
22
- } \
23
- unsigned FUNC_NAME##_us(unsigned short x) __NOEXCEPT { \
24
- return LEADING_VAL##BU; \
25
- } \
26
- unsigned FUNC_NAME##_ui(unsigned int x) __NOEXCEPT { \
27
- return LEADING_VAL##CU; \
28
- } \
29
- unsigned FUNC_NAME##_ul(unsigned long x) __NOEXCEPT { \
30
- return LEADING_VAL##DU; \
31
- } \
32
- unsigned FUNC_NAME##_ull(unsigned long long x) __NOEXCEPT { \
33
- return LEADING_VAL##EU; \
34
- }
20
+ unsigned FUNC_NAME##_uc(unsigned char x) { return LEADING_VAL##AU; } \
21
+ unsigned FUNC_NAME##_us(unsigned short x) { return LEADING_VAL##BU; } \
22
+ unsigned FUNC_NAME##_ui(unsigned int x) { return LEADING_VAL##CU; } \
23
+ unsigned FUNC_NAME##_ul(unsigned long x) { return LEADING_VAL##DU; } \
24
+ unsigned FUNC_NAME##_ull(unsigned long long x) { return LEADING_VAL##EU; }
35
25
36
26
__BEGIN_C_DECLS
37
27
@@ -46,28 +36,24 @@ STDBIT_STUB_FUNCTION(stdc_first_trailing_one, 0x1)
46
36
STDBIT_STUB_FUNCTION (stdc_count_zeros , 0x2 )
47
37
STDBIT_STUB_FUNCTION (stdc_count_ones , 0x3 )
48
38
49
- bool stdc_has_single_bit_uc (unsigned char x ) __NOEXCEPT { return false; }
50
- bool stdc_has_single_bit_us (unsigned short x ) __NOEXCEPT { return false; }
51
- bool stdc_has_single_bit_ui (unsigned x ) __NOEXCEPT { return false; }
52
- bool stdc_has_single_bit_ul (unsigned long x ) __NOEXCEPT { return false; }
53
- bool stdc_has_single_bit_ull (unsigned long long x ) __NOEXCEPT { return false; }
39
+ bool stdc_has_single_bit_uc (unsigned char x ) { return false; }
40
+ bool stdc_has_single_bit_us (unsigned short x ) { return false; }
41
+ bool stdc_has_single_bit_ui (unsigned x ) { return false; }
42
+ bool stdc_has_single_bit_ul (unsigned long x ) { return false; }
43
+ bool stdc_has_single_bit_ull (unsigned long long x ) { return false; }
54
44
55
45
STDBIT_STUB_FUNCTION (stdc_bit_width , 0x4 )
56
46
57
- unsigned char stdc_bit_floor_uc (unsigned char x ) __NOEXCEPT { return 0x5AU ; }
58
- unsigned short stdc_bit_floor_us (unsigned short x ) __NOEXCEPT { return 0x5BU ; }
59
- unsigned stdc_bit_floor_ui (unsigned x ) __NOEXCEPT { return 0x5CU ; }
60
- unsigned long stdc_bit_floor_ul (unsigned long x ) __NOEXCEPT { return 0x5DUL ; }
61
- unsigned long long stdc_bit_floor_ull (unsigned long long x ) __NOEXCEPT {
62
- return 0x5EULL ;
63
- }
64
-
65
- unsigned char stdc_bit_ceil_uc (unsigned char x ) __NOEXCEPT { return 0x6AU ; }
66
- unsigned short stdc_bit_ceil_us (unsigned short x ) __NOEXCEPT { return 0x6BU ; }
67
- unsigned stdc_bit_ceil_ui (unsigned x ) __NOEXCEPT { return 0x6CU ; }
68
- unsigned long stdc_bit_ceil_ul (unsigned long x ) __NOEXCEPT { return 0x6DUL ; }
69
- unsigned long long stdc_bit_ceil_ull (unsigned long long x ) __NOEXCEPT {
70
- return 0x6EULL ;
71
- }
47
+ unsigned char stdc_bit_floor_uc (unsigned char x ) { return 0x5AU ; }
48
+ unsigned short stdc_bit_floor_us (unsigned short x ) { return 0x5BU ; }
49
+ unsigned stdc_bit_floor_ui (unsigned x ) { return 0x5CU ; }
50
+ unsigned long stdc_bit_floor_ul (unsigned long x ) { return 0x5DUL ; }
51
+ unsigned long long stdc_bit_floor_ull (unsigned long long x ) { return 0x5EULL ; }
52
+
53
+ unsigned char stdc_bit_ceil_uc (unsigned char x ) { return 0x6AU ; }
54
+ unsigned short stdc_bit_ceil_us (unsigned short x ) { return 0x6BU ; }
55
+ unsigned stdc_bit_ceil_ui (unsigned x ) { return 0x6CU ; }
56
+ unsigned long stdc_bit_ceil_ul (unsigned long x ) { return 0x6DUL ; }
57
+ unsigned long long stdc_bit_ceil_ull (unsigned long long x ) { return 0x6EULL ; }
72
58
73
59
__END_C_DECLS
0 commit comments