Skip to content

Commit ab07fd9

Browse files
author
Siva Chandra Reddy
committed
[libc][Obvious] Add the LIBC_INLINE tag to a function define in a.h file.
1 parent 43de233 commit ab07fd9

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

libc/src/string/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ add_header_library(
2020
.memory_utils.memcpy_implementation
2121
libc.include.stdlib
2222
libc.src.__support.CPP.optional
23+
libc.src.__support.macros.config
2324
)
2425

2526
add_entrypoint_object(

libc/src/string/allocating_string_utils.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include "src/__support/CPP/new.h"
1313
#include "src/__support/CPP/optional.h"
14+
#include "src/__support/macros/config.h"
1415
#include "src/string/memory_utils/memcpy_implementations.h" // For string_length
1516
#include "src/string/string_utils.h"
1617

@@ -19,7 +20,7 @@
1920
namespace __llvm_libc {
2021
namespace internal {
2122

22-
cpp::optional<char *> strdup(const char *src) {
23+
LIBC_INLINE cpp::optional<char *> strdup(const char *src) {
2324
if (src == nullptr)
2425
return cpp::nullopt;
2526
size_t len = string_length(src) + 1;

0 commit comments

Comments
 (0)