diff --git a/libc/src/string/CMakeLists.txt b/libc/src/string/CMakeLists.txt index 13b9e0179e51f..6dfb6d7bb8e04 100644 --- a/libc/src/string/CMakeLists.txt +++ b/libc/src/string/CMakeLists.txt @@ -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( diff --git a/libc/src/string/allocating_string_utils.h b/libc/src/string/allocating_string_utils.h index 93d1c7ac8e351..71fab3d152066 100644 --- a/libc/src/string/allocating_string_utils.h +++ b/libc/src/string/allocating_string_utils.h @@ -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 strdup(const char *src) { +LIBC_INLINE cpp::optional strdup(const char *src) { if (src == nullptr) return cpp::nullopt; size_t len = string_length(src) + 1;