File tree Expand file tree Collapse file tree 7 files changed +59
-0
lines changed Expand file tree Collapse file tree 7 files changed +59
-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 @@ -5,6 +5,7 @@ set(TARGET_PUBLIC_HEADERS
55 libc.include.dirent
66 libc.include.dlfcn
77 libc.include.elf
8+ libc.include.endian
89 libc.include.errno
910 libc.include.fcntl
1011 libc.include.features
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+ //===-- System V 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
You can’t perform that action at this time.
0 commit comments