Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libc] Include algorithm.h to parser.h #87125

Merged
merged 2 commits into from
Apr 1, 2024
Merged

[libc] Include algorithm.h to parser.h #87125

merged 2 commits into from
Apr 1, 2024

Conversation

Caslyn
Copy link
Contributor

@Caslyn Caslyn commented Mar 29, 2024

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.

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.
@Caslyn Caslyn requested a review from frobtech March 29, 2024 23:22
@Caslyn Caslyn self-assigned this Mar 29, 2024
@llvmbot llvmbot added the libc label Mar 29, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Mar 29, 2024

@llvm/pr-subscribers-libc

Author: Caslyn Tonelli (Caslyn)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/87125.diff

1 Files Affected:

  • (modified) libc/src/stdio/printf_core/parser.h (+1)
diff --git a/libc/src/stdio/printf_core/parser.h b/libc/src/stdio/printf_core/parser.h
index 8e8c77e219fa4d..eda978a83ea8af 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"

@Caslyn Caslyn requested a review from rupprecht as a code owner March 31, 2024 20:05
@llvmbot llvmbot added the bazel "Peripheral" support tier build system: utils/bazel label Mar 31, 2024
@Caslyn Caslyn merged commit d83271b into llvm:main Apr 1, 2024
5 checks passed
@Caslyn Caslyn deleted the add-header branch April 1, 2024 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bazel "Peripheral" support tier build system: utils/bazel libc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants