diff options
author | Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> | 2023-04-12 12:11:37 +0200 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-01-16 18:34:11 +0100 |
commit | 6a569f5c6c0e5da5ff68d94b132d4305bc999bd5 (patch) | |
tree | 64274df96a634ceb58fd06326cb727792cd4db5f /libgrust | |
parent | f4b2b28f325ef693f36776168a40152e9ce6cd34 (diff) | |
download | gcc-6a569f5c6c0e5da5ff68d94b132d4305bc999bd5.zip gcc-6a569f5c6c0e5da5ff68d94b132d4305bc999bd5.tar.gz gcc-6a569f5c6c0e5da5ff68d94b132d4305bc999bd5.tar.bz2 |
gccrs: libproc_macro: Add namespace to Ident
Add a new Ident namespace to group Ident related enumeration and
structures.
libgrust/ChangeLog:
* libproc_macro/ident.cc (Ident::make_ident): Add Ident
namespace.
* libproc_macro/ident.h (Ident__clone): Likewise.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'libgrust')
-rw-r--r-- | libgrust/libproc_macro/ident.cc | 5 | ||||
-rw-r--r-- | libgrust/libproc_macro/ident.h | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/libgrust/libproc_macro/ident.cc b/libgrust/libproc_macro/ident.cc index 6ad9e78..d7d5889 100644 --- a/libgrust/libproc_macro/ident.cc +++ b/libgrust/libproc_macro/ident.cc @@ -23,7 +23,10 @@ #include <cstring> +namespace Ident { + extern "C" { + Ident Ident__new (unsigned char *str, std::uint64_t len) { @@ -72,3 +75,5 @@ Ident::make_ident (const unsigned char *str, std::uint64_t len, bool raw) std::memcpy (val, str, len); return {raw, val, len}; } + +} // namespace Ident diff --git a/libgrust/libproc_macro/ident.h b/libgrust/libproc_macro/ident.h index 8ab7e6d..5a2a46a 100644 --- a/libgrust/libproc_macro/ident.h +++ b/libgrust/libproc_macro/ident.h @@ -26,6 +26,8 @@ #include <cstdint> #include <string> +namespace Ident { + struct Ident { bool is_raw; @@ -56,4 +58,6 @@ Ident Ident__clone (const Ident *ident); } +} // namespace Ident + #endif /* ! IDENT_H */ |