[libc-commits] [libc] 2ce10f0 - [libc] Remove the <string.h> header in libc/src and libc/test (#113076)

via libc-commits libc-commits at lists.llvm.org
Sun Oct 20 09:05:44 PDT 2024


Author: Job Henandez Lara
Date: 2024-10-20T09:05:41-07:00
New Revision: 2ce10f0491142863d3f21cd0adb312ab2cfed107

URL: https://github.com/llvm/llvm-project/commit/2ce10f0491142863d3f21cd0adb312ab2cfed107
DIFF: https://github.com/llvm/llvm-project/commit/2ce10f0491142863d3f21cd0adb312ab2cfed107.diff

LOG: [libc] Remove the <string.h> header in libc/src and libc/test (#113076)

Added: 
    

Modified: 
    libc/src/string/CMakeLists.txt
    libc/src/string/strcat.h
    libc/src/string/strcpy.h
    libc/src/string/strdup.h
    libc/src/string/strlcat.h
    libc/src/string/strlcpy.h
    libc/src/string/strlen.h
    libc/src/string/strncat.h
    libc/src/string/strndup.h

Removed: 
    


################################################################################
diff  --git a/libc/src/string/CMakeLists.txt b/libc/src/string/CMakeLists.txt
index 787188ab3beb91..b33cbc5358d60d 100644
--- a/libc/src/string/CMakeLists.txt
+++ b/libc/src/string/CMakeLists.txt
@@ -138,6 +138,7 @@ add_entrypoint_object(
   DEPENDS
     .strcpy
     .string_utils
+    libc.include.llvm-libc-types.size_t
 )
 
 add_entrypoint_object(
@@ -240,6 +241,7 @@ add_entrypoint_object(
     .string_utils
     libc.include.stdlib
     libc.src.errno.errno
+    libc.include.llvm-libc-types.size_t
 )
 
 add_entrypoint_object(
@@ -270,7 +272,7 @@ add_entrypoint_object(
     strlcat.h
   DEPENDS
     .string_utils
-    libc.include.string
+    libc.include.llvm-libc-types.size_t
 )
 
 add_entrypoint_object(
@@ -281,7 +283,7 @@ add_entrypoint_object(
     strlcpy.h
   DEPENDS
     .string_utils
-    libc.include.string
+    libc.include.llvm-libc-types.size_t
 )
 
 add_entrypoint_object(
@@ -292,7 +294,7 @@ add_entrypoint_object(
     strlen.h
   DEPENDS
     .string_utils
-    libc.include.string
+    libc.include.llvm-libc-types.size_t
 )
 
 add_entrypoint_object(
@@ -304,6 +306,7 @@ add_entrypoint_object(
   DEPENDS
     .strncpy
     .string_utils
+    libc.include.llvm-libc-types.size_t
 )
 
 add_entrypoint_object(
@@ -346,6 +349,7 @@ add_entrypoint_object(
     .string_utils
     libc.include.stdlib
     libc.src.__support.CPP.new
+    libc.include.llvm-libc-types.size_t
 )
 
 add_entrypoint_object(

diff  --git a/libc/src/string/strcat.h b/libc/src/string/strcat.h
index 90a7fd2e41337e..82860196ce29a2 100644
--- a/libc/src/string/strcat.h
+++ b/libc/src/string/strcat.h
@@ -9,8 +9,8 @@
 #ifndef LLVM_LIBC_SRC_STRING_STRCAT_H
 #define LLVM_LIBC_SRC_STRING_STRCAT_H
 
+#include "include/llvm-libc-types/size_t.h"
 #include "src/__support/macros/config.h"
-#include <string.h>
 
 namespace LIBC_NAMESPACE_DECL {
 

diff  --git a/libc/src/string/strcpy.h b/libc/src/string/strcpy.h
index d4f3e81fdc733a..9e0c3dbc39ef90 100644
--- a/libc/src/string/strcpy.h
+++ b/libc/src/string/strcpy.h
@@ -9,8 +9,8 @@
 #ifndef LLVM_LIBC_SRC_STRING_STRCPY_H
 #define LLVM_LIBC_SRC_STRING_STRCPY_H
 
+#include "include/llvm-libc-types/size_t.h"
 #include "src/__support/macros/config.h"
-#include <string.h>
 
 namespace LIBC_NAMESPACE_DECL {
 

diff  --git a/libc/src/string/strdup.h b/libc/src/string/strdup.h
index 45303a3efeb493..2744e53d45d475 100644
--- a/libc/src/string/strdup.h
+++ b/libc/src/string/strdup.h
@@ -9,8 +9,8 @@
 #ifndef LLVM_LIBC_SRC_STRING_STRDUP_H
 #define LLVM_LIBC_SRC_STRING_STRDUP_H
 
+#include "include/llvm-libc-types/size_t.h"
 #include "src/__support/macros/config.h"
-#include <string.h>
 
 namespace LIBC_NAMESPACE_DECL {
 

diff  --git a/libc/src/string/strlcat.h b/libc/src/string/strlcat.h
index ffe97af62a543c..9dc8f3a3bc0d18 100644
--- a/libc/src/string/strlcat.h
+++ b/libc/src/string/strlcat.h
@@ -9,8 +9,8 @@
 #ifndef LLVM_LIBC_SRC_STRING_STRLCAT_H
 #define LLVM_LIBC_SRC_STRING_STRLCAT_H
 
+#include "include/llvm-libc-types/size_t.h"
 #include "src/__support/macros/config.h"
-#include <string.h>
 
 namespace LIBC_NAMESPACE_DECL {
 

diff  --git a/libc/src/string/strlcpy.h b/libc/src/string/strlcpy.h
index 058e7653b1b91f..45b2c2a2ec26b4 100644
--- a/libc/src/string/strlcpy.h
+++ b/libc/src/string/strlcpy.h
@@ -9,8 +9,8 @@
 #ifndef LLVM_LIBC_SRC_STRING_STRLCPY_H
 #define LLVM_LIBC_SRC_STRING_STRLCPY_H
 
+#include "include/llvm-libc-types/size_t.h"
 #include "src/__support/macros/config.h"
-#include <string.h>
 
 namespace LIBC_NAMESPACE_DECL {
 

diff  --git a/libc/src/string/strlen.h b/libc/src/string/strlen.h
index f07bf73ace3de6..093edcf479bcf2 100644
--- a/libc/src/string/strlen.h
+++ b/libc/src/string/strlen.h
@@ -9,8 +9,8 @@
 #ifndef LLVM_LIBC_SRC_STRING_STRLEN_H
 #define LLVM_LIBC_SRC_STRING_STRLEN_H
 
+#include "include/llvm-libc-types/size_t.h"
 #include "src/__support/macros/config.h"
-#include <string.h>
 
 namespace LIBC_NAMESPACE_DECL {
 

diff  --git a/libc/src/string/strncat.h b/libc/src/string/strncat.h
index 1a130799f39658..f37d9a7bc1544a 100644
--- a/libc/src/string/strncat.h
+++ b/libc/src/string/strncat.h
@@ -9,8 +9,8 @@
 #ifndef LLVM_LIBC_SRC_STRING_STRNCAT_H
 #define LLVM_LIBC_SRC_STRING_STRNCAT_H
 
+#include "include/llvm-libc-types/size_t.h"
 #include "src/__support/macros/config.h"
-#include <string.h>
 
 namespace LIBC_NAMESPACE_DECL {
 

diff  --git a/libc/src/string/strndup.h b/libc/src/string/strndup.h
index 03370cc8d7dce1..78cde7b33e13b1 100644
--- a/libc/src/string/strndup.h
+++ b/libc/src/string/strndup.h
@@ -9,8 +9,8 @@
 #ifndef LLVM_LIBC_SRC_STRING_STRNDUP_H
 #define LLVM_LIBC_SRC_STRING_STRNDUP_H
 
+#include "include/llvm-libc-types/size_t.h"
 #include "src/__support/macros/config.h"
-#include <string.h>
 
 namespace LIBC_NAMESPACE_DECL {
 


        


More information about the libc-commits mailing list