From 6d1adb5c393814fd800c0fcf153204b6bf9ba417 Mon Sep 17 00:00:00 2001 From: Pierre-Emmanuel Patry Date: Thu, 27 Jul 2023 15:22:48 +0200 Subject: [PATCH] gccrs: Move callbacked function in a new namespace Move the function registered as a callback in a new anonymous namespace in order to group every callback in the future under the same namespace. gcc/rust/ChangeLog: * expand/rust-proc-macro.cc: Remove static modifier and move to an anonymous namespace. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/expand/rust-proc-macro.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/rust/expand/rust-proc-macro.cc b/gcc/rust/expand/rust-proc-macro.cc index 9fee4bb03bd..c664e20ecbc 100644 --- a/gcc/rust/expand/rust-proc-macro.cc +++ b/gcc/rust/expand/rust-proc-macro.cc @@ -26,7 +26,9 @@ namespace Rust { const std::string PROC_MACRO_DECL_PREFIX = "__gccrs_proc_macro_decls_"; -static ProcMacro::TokenStream +namespace { + +ProcMacro::TokenStream tokenstream_from_string (std::string &data, bool &lex_error) { // FIXME: Insert location pointing to call site in tokens @@ -56,6 +58,8 @@ static_assert ( ProcMacro::from_str_function_t>::value, "Registration callback signature not synced, check proc macro internals."); +} // namespace + template bool register_callback (void *handle, Symbol, std::string symbol_name,