[libc][Obvious] Add the LIBC_INLINE tag to a function define in a.h file.
authorSiva Chandra Reddy <sivachandra@google.com>
Sun, 5 Mar 2023 02:58:45 +0000 (02:58 +0000)
committerSiva Chandra Reddy <sivachandra@google.com>
Sun, 5 Mar 2023 02:58:45 +0000 (02:58 +0000)
libc/src/string/CMakeLists.txt
libc/src/string/allocating_string_utils.h

index 13b9e01..6dfb6d7 100644 (file)
@@ -20,6 +20,7 @@ add_header_library(
     .memory_utils.memcpy_implementation
     libc.include.stdlib
     libc.src.__support.CPP.optional
+    libc.src.__support.macros.config
 )
 
 add_entrypoint_object(
index 93d1c7a..71fab3d 100644 (file)
@@ -11,6 +11,7 @@
 
 #include "src/__support/CPP/new.h"
 #include "src/__support/CPP/optional.h"
+#include "src/__support/macros/config.h"
 #include "src/string/memory_utils/memcpy_implementations.h" // For string_length
 #include "src/string/string_utils.h"
 
@@ -19,7 +20,7 @@
 namespace __llvm_libc {
 namespace internal {
 
-cpp::optional<char *> strdup(const char *src) {
+LIBC_INLINE cpp::optional<char *> strdup(const char *src) {
   if (src == nullptr)
     return cpp::nullopt;
   size_t len = string_length(src) + 1;