File tree Expand file tree Collapse file tree 3 files changed +20
-5
lines changed Expand file tree Collapse file tree 3 files changed +20
-5
lines changed Original file line number Diff line number Diff line change 9
9
#ifndef __LLVM_LIBC_MACROS_STDBIT_MACROS_H
10
10
#define __LLVM_LIBC_MACROS_STDBIT_MACROS_H
11
11
12
+ #ifdef __cplusplus
13
+ inline unsigned char stdc_leading_zeros (unsigned char x ) {
14
+ return stdc_leading_zeros_uc (x );
15
+ }
16
+ inline unsigned short stdc_leading_zeros (unsigned short x ) {
17
+ return stdc_leading_zeros_us (x );
18
+ }
19
+ inline unsigned stdc_leading_zeros (unsigned x ) {
20
+ return stdc_leading_zeros_ui (x );
21
+ }
22
+ inline unsigned long stdc_leading_zeros (unsigned long x ) {
23
+ return stdc_leading_zeros_ul (x );
24
+ }
25
+ inline unsigned long long stdc_leading_zeros (unsigned long long x ) {
26
+ return stdc_leading_zeros_ull (x );
27
+ }
28
+ #else
12
29
#define stdc_leading_zeros (x ) \
13
30
_Generic((x), \
14
31
unsigned char: stdc_leading_zeros_uc, \
15
32
unsigned short: stdc_leading_zeros_us, \
16
33
unsigned: stdc_leading_zeros_ui, \
17
34
unsigned long: stdc_leading_zeros_ul, \
18
35
unsigned long long: stdc_leading_zeros_ull)(x)
36
+ #endif // __cplusplus
19
37
20
38
#endif // __LLVM_LIBC_MACROS_STDBIT_MACROS_H
Original file line number Diff line number Diff line change 10
10
#define LLVM_LIBC_STDBIT_H
11
11
12
12
#include <__llvm-libc-common.h>
13
- #include <llvm-libc-macros/stdbit-macros.h>
14
13
15
14
%%public_api()
16
15
16
+ #include <llvm-libc-macros/stdbit-macros.h>
17
+
17
18
#endif // LLVM_LIBC_STDBIT_H
Original file line number Diff line number Diff line change @@ -31,9 +31,5 @@ if (LLVM_LIBC_FULL_BUILD)
31
31
# simply testing the macros provided by stdbit.h, not the implementation
32
32
# of the underlying functions which the type generic macros may dispatch
33
33
# to.
34
- COMPILE_OPTIONS
35
- # stdbit.h is full of type generic macros implemented via C11 _Generic.
36
- # Clang will produce -Wno-c11-extensions when using _Generic in C++ mode.
37
- -Wno-c11-extensions
38
34
)
39
35
endif ()
You can’t perform that action at this time.
0 commit comments