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
44 libc.include.ctype
55 libc.include.dlfcn
66 libc.include.elf
7+ libc.include.endian
78 libc.include.errno
89 libc.include.features
910 libc.include.fenv
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ set(TARGET_PUBLIC_HEADERS
66 libc.include.dirent
77 libc.include.dlfcn
88 libc.include.elf
9+ libc.include.endian
910 libc.include.errno
1011 libc.include.fcntl
1112 libc.include.features
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ if (SPHINX_FOUND)
3939 assert
4040 cpio
4141 ctype
42+ endian
4243 errno
4344 fenv
4445 float
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ Implementation Status
1010 complex
1111 cpio
1212 ctype
13+ endian
1314 errno
1415 fenv
1516 float
Original file line number Diff line number Diff line change @@ -73,6 +73,15 @@ add_header_macro(
7373 .llvm_libc_common_h
7474)
7575
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+
7685add_header_macro(
7786 features
7887 ../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(
310310 elf-macros .h
311311)
312312
313+ add_macro_header(
314+ endian_macros
315+ HDR
316+ endian-macros .h
317+ )
318+
313319add_macro_header(
314320 locale_macros
315321 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