File tree Expand file tree Collapse file tree 10 files changed +93
-0
lines changed Expand file tree Collapse file tree 10 files changed +93
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ set(TARGET_PUBLIC_HEADERS
4
4
libc.include.ctype
5
5
libc.include.dlfcn
6
6
libc.include.elf
7
+ libc.include.endian
7
8
libc.include.errno
8
9
libc.include.features
9
10
libc.include.fenv
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ set(TARGET_PUBLIC_HEADERS
6
6
libc.include.dirent
7
7
libc.include.dlfcn
8
8
libc.include.elf
9
+ libc.include.endian
9
10
libc.include.errno
10
11
libc.include.fcntl
11
12
libc.include.features
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ if (SPHINX_FOUND)
39
39
assert
40
40
cpio
41
41
ctype
42
+ endian
42
43
errno
43
44
fenv
44
45
float
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ Implementation Status
10
10
complex
11
11
cpio
12
12
ctype
13
+ endian
13
14
errno
14
15
fenv
15
16
float
Original file line number Diff line number Diff line change @@ -73,6 +73,15 @@ add_header_macro(
73
73
.llvm_libc_common_h
74
74
)
75
75
76
+ add_header_macro (
77
+ endian
78
+ ../libc/include/endian.yaml
79
+ endian.h
80
+ DEPENDS
81
+ .llvm-libc-macros.endian_macros
82
+ .llvm_libc_common_h
83
+ )
84
+
76
85
add_header_macro (
77
86
features
78
87
../libc/include/features.yaml
Original file line number Diff line number Diff line change
1
+ //===-- POSIX header endian.h ---------------------------------------------===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+
9
+ #ifndef LLVM_LIBC_ENDIAN_H
10
+ #define LLVM_LIBC_ENDIAN_H
11
+
12
+ #include "__llvm-libc-common.h"
13
+ #include "llvm-libc-macros/endian-macros.h"
14
+
15
+ %%public_api()
16
+
17
+ #endif // LLVM_LIBC_ENDIAN_H
Original file line number Diff line number Diff line change
1
+ header : endian.h
2
+ header_template : endian.h.def
3
+ standards :
4
+ - POSIX
5
+ macros : []
6
+ types : []
7
+ enums : []
8
+ objects : []
9
+ functions : []
Original file line number Diff line number Diff line change @@ -310,6 +310,12 @@ add_macro_header(
310
310
elf-macros.h
311
311
)
312
312
313
+ add_macro_header (
314
+ endian_macros
315
+ HDR
316
+ endian-macros.h
317
+ )
318
+
313
319
add_macro_header (
314
320
locale_macros
315
321
HDR
Original file line number Diff line number Diff line change
1
+ //===-- Definition of macros from endian.h --------------------------------===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ //===----------------------------------------------------------------------===//
8
+
9
+ #ifndef LLVM_LIBC_MACROS_ENDIAN_MACROS_H
10
+ #define LLVM_LIBC_MACROS_ENDIAN_MACROS_H
11
+
12
+ #define LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__
13
+ #define BIG_ENDIAN __ORDER_BIG_ENDIAN__
14
+ #define BYTE_ORDER __BYTE_ORDER__
15
+
16
+ #endif // LLVM_LIBC_MACROS_ENDIAN_MACROS_H
Original file line number Diff line number Diff line change
1
+ macros :
2
+ LITTLE_ENDIAN :
3
+ in-latest-posix : ' '
4
+ BIG_ENDIAN :
5
+ in-latest-posix : ' '
6
+ BYTE_ORDER :
7
+ in-latest-posix : ' '
8
+ be16toh :
9
+ in-latest-posix : ' '
10
+ be32toh :
11
+ in-latest-posix : ' '
12
+ be64toh :
13
+ in-latest-posix : ' '
14
+ htobe16 :
15
+ in-latest-posix : ' '
16
+ htobe32 :
17
+ in-latest-posix : ' '
18
+ htobe64 :
19
+ in-latest-posix : ' '
20
+ htole16 :
21
+ in-latest-posix : ' '
22
+ htole32 :
23
+ in-latest-posix : ' '
24
+ htole64 :
25
+ in-latest-posix : ' '
26
+ le16toh :
27
+ in-latest-posix : ' '
28
+ le32toh :
29
+ in-latest-posix : ' '
30
+ le64toh :
31
+ in-latest-posix : ' '
32
+
You can’t perform that action at this time.
0 commit comments