diff options
author | Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> | 2023-07-27 15:22:48 +0200 |
---|---|---|
committer | P-E-P <32375388+P-E-P@users.noreply.github.com> | 2023-07-28 09:15:21 +0000 |
commit | 9b62bc32f58925e9d74fdb11e13fad23c6d9d3e8 (patch) | |
tree | 14ad992f012db801d4d5599b5458527885d67de9 /gcc/rust | |
parent | b4d1406d6d9f44899bc4f8ea4b3d10b538727796 (diff) | |
download | gcc-9b62bc32f58925e9d74fdb11e13fad23c6d9d3e8.zip gcc-9b62bc32f58925e9d74fdb11e13fad23c6d9d3e8.tar.gz gcc-9b62bc32f58925e9d74fdb11e13fad23c6d9d3e8.tar.bz2 |
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 <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc/rust')
-rw-r--r-- | gcc/rust/expand/rust-proc-macro.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/rust/expand/rust-proc-macro.cc b/gcc/rust/expand/rust-proc-macro.cc index 9fee4bb..c664e20 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 <typename Symbol, typename Callback> bool register_callback (void *handle, Symbol, std::string symbol_name, |