aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaslyn Tonelli <6718161+Caslyn@users.noreply.github.com>2024-04-01 09:51:38 -0700
committerGitHub <noreply@github.com>2024-04-01 09:51:38 -0700
commitd83271b093ec206c2f47a9c636a5727cf63cad5e (patch)
tree5473d286d69571d9a7fe46aaf3eb679580d044ca
parenta8cfa7cbdf6cc1a94ed25c90897d2e031f77a5a9 (diff)
downloadllvm-d83271b093ec206c2f47a9c636a5727cf63cad5e.zip
llvm-d83271b093ec206c2f47a9c636a5727cf63cad5e.tar.gz
llvm-d83271b093ec206c2f47a9c636a5727cf63cad5e.tar.bz2
[libc] Include algorithm.h to parser.h (#87125)
This includes algorithm.h directly to provide the definition for `cpp:max` in parser.h. This will define `max(...)` in the libc namespace for build systems that pull in parser.h explicitly.
-rw-r--r--libc/src/stdio/printf_core/CMakeLists.txt1
-rw-r--r--libc/src/stdio/printf_core/parser.h1
-rw-r--r--utils/bazel/llvm-project-overlay/libc/BUILD.bazel1
3 files changed, 3 insertions, 0 deletions
diff --git a/libc/src/stdio/printf_core/CMakeLists.txt b/libc/src/stdio/printf_core/CMakeLists.txt
index 02819ea..7db79c5 100644
--- a/libc/src/stdio/printf_core/CMakeLists.txt
+++ b/libc/src/stdio/printf_core/CMakeLists.txt
@@ -42,6 +42,7 @@ add_header_library(
libc.src.__support.arg_list
libc.src.__support.ctype_utils
libc.src.__support.str_to_integer
+ libc.src.__support.CPP.algorithm
libc.src.__support.CPP.bit
libc.src.__support.CPP.optional
libc.src.__support.CPP.string_view
diff --git a/libc/src/stdio/printf_core/parser.h b/libc/src/stdio/printf_core/parser.h
index 8e8c77e..eda978a 100644
--- a/libc/src/stdio/printf_core/parser.h
+++ b/libc/src/stdio/printf_core/parser.h
@@ -10,6 +10,7 @@
#define LLVM_LIBC_SRC_STDIO_PRINTF_CORE_PARSER_H
#include "include/llvm-libc-macros/stdfix-macros.h"
+#include "src/__support/CPP/algorithm.h" // max
#include "src/__support/CPP/optional.h"
#include "src/__support/CPP/type_traits.h"
#include "src/__support/str_to_integer.h"
diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
index 9169f33..9dfe4c4 100644
--- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
@@ -3041,6 +3041,7 @@ libc_support_library(
deps = [
":__support_arg_list",
":__support_common",
+ ":__support_cpp_algorithm",
":__support_cpp_bit",
":__support_cpp_optional",
":__support_cpp_string_view",