[libc-commits] [libc] [libc] Remove asm-generic includes from tests (PR #114479)
Michael Jones via libc-commits
libc-commits at lists.llvm.org
Thu Oct 31 15:47:30 PDT 2024
https://github.com/michaelrj-google created https://github.com/llvm/llvm-project/pull/114479
We shouldn't be including headers directly from asm-generic for macros.
It's safer to get those through the correct primary header where
possible (e.g. fcntl instead of asm-generic/fcntl).
For our public headers we may need to include the asm-generic
headers instead of defining all the macros ourselves, but that's
something for a followup PR.
>From ff59c2f6c742694504d888e7deb003dfbc51f00e Mon Sep 17 00:00:00 2001
From: Michael Jones <michaelrj at google.com>
Date: Thu, 31 Oct 2024 14:25:48 -0700
Subject: [PATCH] [libc] Remove asm-generic includes from tests
We shouldn't be including headers directly from asm-generic for macros.
It's safer to get those through the correct primary header where
possible (e.g. fcntl instead of asm-generic/fcntl).
For our public headers we may need to include the asm-generic
headers instead of defining all the macros ourselves, but that's
something for a followup PR.
---
libc/test/src/search/hsearch_test.cpp | 1 -
libc/test/src/sys/mman/linux/mlock_test.cpp | 2 --
2 files changed, 3 deletions(-)
diff --git a/libc/test/src/search/hsearch_test.cpp b/libc/test/src/search/hsearch_test.cpp
index f7d94791f2bc03..01805d8f5b4da9 100644
--- a/libc/test/src/search/hsearch_test.cpp
+++ b/libc/test/src/search/hsearch_test.cpp
@@ -15,7 +15,6 @@
#include "src/search/hsearch.h"
#include "test/UnitTest/ErrnoSetterMatcher.h"
#include "test/UnitTest/Test.h"
-#include <asm-generic/errno-base.h>
TEST(LlvmLibcHsearchTest, CreateTooLarge) {
using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Fails;
diff --git a/libc/test/src/sys/mman/linux/mlock_test.cpp b/libc/test/src/sys/mman/linux/mlock_test.cpp
index 804038a68a7e09..c6e459276a8fbf 100644
--- a/libc/test/src/sys/mman/linux/mlock_test.cpp
+++ b/libc/test/src/sys/mman/linux/mlock_test.cpp
@@ -23,8 +23,6 @@
#include "test/UnitTest/LibcTest.h"
#include "test/UnitTest/Test.h"
-#include <asm-generic/errno-base.h>
-#include <asm-generic/mman.h>
#include <linux/capability.h>
#include <sys/mman.h>
#include <sys/resource.h>
More information about the libc-commits
mailing list