-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc] Add the <endian.h>
header.
#125168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,7 @@ if (SPHINX_FOUND) | |
assert | ||
cpio | ||
ctype | ||
endian | ||
errno | ||
fenv | ||
float | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ Implementation Status | |
complex | ||
cpio | ||
ctype | ||
endian | ||
errno | ||
fenv | ||
float | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
//===-- POSIX header endian.h ---------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef LLVM_LIBC_ENDIAN_H | ||
#define LLVM_LIBC_ENDIAN_H | ||
|
||
#include "__llvm-libc-common.h" | ||
#include "llvm-libc-macros/endian-macros.h" | ||
|
||
%%public_api() | ||
|
||
#endif // LLVM_LIBC_ENDIAN_H |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
header: endian.h | ||
header_template: endian.h.def | ||
standards: | ||
- POSIX | ||
macros: [] | ||
types: [] | ||
enums: [] | ||
objects: [] | ||
functions: [] | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//===-- Definition of macros from endian.h --------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef LLVM_LIBC_MACROS_ENDIAN_MACROS_H | ||
#define LLVM_LIBC_MACROS_ENDIAN_MACROS_H | ||
|
||
#define LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__ | ||
#define BIG_ENDIAN __ORDER_BIG_ENDIAN__ | ||
#define BYTE_ORDER __BYTE_ORDER__ | ||
|
||
#endif // LLVM_LIBC_MACROS_ENDIAN_MACROS_H |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
macros: | ||
LITTLE_ENDIAN: | ||
in-latest-posix: '' | ||
BIG_ENDIAN: | ||
in-latest-posix: '' | ||
BYTE_ORDER: | ||
in-latest-posix: '' | ||
be16toh: | ||
in-latest-posix: '' | ||
be32toh: | ||
in-latest-posix: '' | ||
be64toh: | ||
in-latest-posix: '' | ||
htobe16: | ||
in-latest-posix: '' | ||
htobe32: | ||
in-latest-posix: '' | ||
htobe64: | ||
in-latest-posix: '' | ||
htole16: | ||
in-latest-posix: '' | ||
htole32: | ||
in-latest-posix: '' | ||
htole64: | ||
in-latest-posix: '' | ||
le16toh: | ||
in-latest-posix: '' | ||
le32toh: | ||
in-latest-posix: '' | ||
le64toh: | ||
in-latest-posix: '' | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you mind stubbing out the rest of the functions listed at https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/endian.h.html? Otherwise, we will render a doc where it looks like our implementation of endian.h is complete; it's not, since we don't have the functions defined. That way, folks know what to expect, and can find more places to contribute. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SGTM; thanks! I wonder what happens if someone needs to link against them as strong symbols... |
Uh oh!
There was an error while loading. Please reload this page.