Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 95b680e

Browse files
authoredNov 13, 2024··
[libc] Rename libc/src/__support/endian.h to endian_internal.h (#115950)
This prevents a conflict with the Linux system endian.h when built in overlay mode for CPP files in __support. This issue appeared in PR #106259.
1 parent 57cf199 commit 95b680e

File tree

17 files changed

+21
-21
lines changed

17 files changed

+21
-21
lines changed
 

‎libc/src/__support/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ add_header_library(
5555
common
5656
HDRS
5757
common.h
58-
endian.h
58+
endian_internal.h
5959
macros/properties/architectures.h
6060
macros/attributes.h
6161
macros/properties/cpu_features.h

‎libc/src/__support/HashTable/generic/bitmask_impl.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "src/__support/common.h"
10-
#include "src/__support/endian.h"
10+
#include "src/__support/endian_internal.h"
1111
#include "src/__support/macros/config.h"
1212

1313
namespace LIBC_NAMESPACE_DECL {

‎libc/src/__support/endian.h renamed to ‎libc/src/__support/endian_internal.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef LLVM_LIBC_SRC___SUPPORT_ENDIAN_H
10-
#define LLVM_LIBC_SRC___SUPPORT_ENDIAN_H
9+
#ifndef LLVM_LIBC_SRC___SUPPORT_ENDIAN_INTERNAL_H
10+
#define LLVM_LIBC_SRC___SUPPORT_ENDIAN_INTERNAL_H
1111

1212
#include "common.h"
1313
#include "src/__support/macros/config.h"
@@ -143,4 +143,4 @@ using Endian = internal::Endian<__BYTE_ORDER__>;
143143

144144
} // namespace LIBC_NAMESPACE_DECL
145145

146-
#endif // LLVM_LIBC_SRC___SUPPORT_ENDIAN_H
146+
#endif // LLVM_LIBC_SRC___SUPPORT_ENDIAN_INTERNAL_H

‎libc/src/network/htonl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include "src/network/htonl.h"
1010
#include "src/__support/common.h"
11-
#include "src/__support/endian.h"
11+
#include "src/__support/endian_internal.h"
1212
#include "src/__support/macros/config.h"
1313

1414
namespace LIBC_NAMESPACE_DECL {

‎libc/src/network/htons.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include "src/network/htons.h"
1010
#include "src/__support/common.h"
11-
#include "src/__support/endian.h"
11+
#include "src/__support/endian_internal.h"
1212
#include "src/__support/macros/config.h"
1313

1414
namespace LIBC_NAMESPACE_DECL {

‎libc/src/network/ntohl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include "src/network/ntohl.h"
1010
#include "src/__support/common.h"
11-
#include "src/__support/endian.h"
11+
#include "src/__support/endian_internal.h"
1212
#include "src/__support/macros/config.h"
1313

1414
namespace LIBC_NAMESPACE_DECL {

‎libc/src/network/ntohs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#include "src/network/ntohs.h"
1010
#include "src/__support/common.h"
11-
#include "src/__support/endian.h"
11+
#include "src/__support/endian_internal.h"
1212
#include "src/__support/macros/config.h"
1313

1414
namespace LIBC_NAMESPACE_DECL {

‎libc/src/string/memory_utils/op_generic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include "src/__support/CPP/array.h"
2727
#include "src/__support/CPP/type_traits.h"
2828
#include "src/__support/common.h"
29-
#include "src/__support/endian.h"
29+
#include "src/__support/endian_internal.h"
3030
#include "src/__support/macros/config.h"
3131
#include "src/__support/macros/optimization.h"
3232
#include "src/__support/macros/properties/types.h" // LIBC_TYPES_HAS_INT64

‎libc/src/string/memory_utils/utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "src/__support/CPP/bit.h"
1313
#include "src/__support/CPP/cstddef.h"
1414
#include "src/__support/CPP/type_traits.h"
15-
#include "src/__support/endian.h"
15+
#include "src/__support/endian_internal.h"
1616
#include "src/__support/macros/attributes.h" // LIBC_INLINE
1717
#include "src/__support/macros/config.h"
1818
#include "src/__support/macros/properties/architectures.h"

‎libc/test/src/__support/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ add_libc_test(
5757
)
5858

5959
add_libc_test(
60-
endian_test
60+
endian_internal_test
6161
SUITE
6262
libc-support-tests
6363
SRCS
64-
endian_test.cpp
64+
endian_internal_test.cpp
6565
DEPENDS
6666
libc.src.__support.common
6767
)

‎libc/test/src/__support/endian_test.cpp renamed to ‎libc/test/src/__support/endian_internal_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "src/__support/endian.h"
9+
#include "src/__support/endian_internal.h"
1010
#include "src/__support/macros/config.h"
1111
#include "test/UnitTest/Test.h"
1212

‎libc/test/src/network/htonl_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "src/__support/endian.h"
9+
#include "src/__support/endian_internal.h"
1010
#include "src/network/htonl.h"
1111
#include "src/network/ntohl.h"
1212
#include "test/UnitTest/Test.h"

‎libc/test/src/network/htons_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "src/__support/endian.h"
9+
#include "src/__support/endian_internal.h"
1010
#include "src/network/htons.h"
1111
#include "src/network/ntohs.h"
1212
#include "test/UnitTest/Test.h"

‎libc/test/src/network/ntohl_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "src/__support/endian.h"
9+
#include "src/__support/endian_internal.h"
1010
#include "src/network/htonl.h"
1111
#include "src/network/ntohl.h"
1212
#include "test/UnitTest/Test.h"

‎libc/test/src/network/ntohs_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "src/__support/endian.h"
9+
#include "src/__support/endian_internal.h"
1010
#include "src/network/htons.h"
1111
#include "src/network/ntohs.h"
1212
#include "test/UnitTest/Test.h"

‎utils/bazel/llvm-project-overlay/libc/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ libc_support_library(
425425
name = "__support_common",
426426
hdrs = [
427427
"src/__support/common.h",
428-
"src/__support/endian.h",
428+
"src/__support/endian_internal.h",
429429
],
430430
deps = [
431431
":__support_macros_attributes",

‎utils/bazel/llvm-project-overlay/libc/test/src/__support/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ libc_test(
3030
# )
3131

3232
libc_test(
33-
name = "endian_test",
34-
srcs = ["endian_test.cpp"],
33+
name = "endian_internal_test",
34+
srcs = ["endian_internal_test.cpp"],
3535
deps = ["//libc:__support_common"],
3636
)
3737

0 commit comments

Comments
 (0)
Please sign in to comment.