public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] libproc_macro: Add namespace to Ident
@ 2023-05-02 7:09 Thomas Schwinge
0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2023-05-02 7:09 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:52e4af4f391c0152068a537d7714bb5f815f9117
commit 52e4af4f391c0152068a537d7714bb5f815f9117
Author: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Date: Wed Apr 12 12:11:37 2023 +0200
libproc_macro: Add namespace to Ident
Add a new Ident namespace to group Ident related enumeration and
structures.
ChangeLog:
* libgrust/libproc_macro/ident.cc (Ident::make_ident): Add Ident
namespace.
* libgrust/libproc_macro/ident.h (Ident__clone): Likewise.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diff:
---
libgrust/libproc_macro/ident.cc | 5 +++++
libgrust/libproc_macro/ident.h | 4 ++++
2 files changed, 9 insertions(+)
diff --git a/libgrust/libproc_macro/ident.cc b/libgrust/libproc_macro/ident.cc
index 6ad9e7807f1..d7d588975d7 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 8ab7e6dc324..5a2a46a8c1f 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 */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-05-02 7:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-02 7:09 [gcc/devel/rust/master] libproc_macro: Add namespace to Ident Thomas Schwinge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).