Recent changes in the rust interface on some extern C function shall be
synced up in the C++ library.
libgrust/ChangeLog:
* libproc_macro/literal.cc (Literal__from_string):
Update to match rust interface.
* libproc_macro/literal.h (Literal__from_string):
Likewise.
* libproc_macro/tokenstream.cc (TokenStream__from_string):
Likewise.
* libproc_macro/tokenstream.h (TokenStream__from_string):
Likewise.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
extern "C" {
bool
-Literal__from_string (const unsigned char *str, std::uint64_t len, Literal *lit)
+Literal__from_string (FFIString str, Literal *lit)
{
// FIXME: implement this function with lexer
std::abort ();
extern "C" {
bool
-Literal__from_string (const unsigned char *str, std::uint64_t len,
- Literal *lit);
+Literal__from_string (FFIString str, Literal *lit);
}
} // namespace ProcMacro
}
extern "C" bool
-TokenStream__from_string (unsigned char *str, std::uint64_t len,
- TokenStream *ts)
+TokenStream__from_string (FFIString str, TokenStream *ts)
{
bool result;
- auto source = std::string (reinterpret_cast<const char *> (str), len);
+ auto source = str.to_string ();
*ts = TokenStream::make_tokenstream (source, result);
return result;
#include <vector>
#include <string>
+#include "ffistring.h"
+
namespace ProcMacro {
struct TokenTree;
TokenSream__push (TokenStream *stream, TokenTree tree);
extern "C" bool
-TokenStream__from_string (unsigned char *str, std::uint64_t len,
- TokenStream *ts);
+TokenStream__from_string (FFIString str, TokenStream *ts);
extern "C" TokenStream
TokenStream__clone (const TokenStream *ts);