lix/src/libutil/rust-ffi.cc

25 lines
442 B
C++
Raw Normal View History

#if 0
#include "logging.hh"
2019-09-11 11:10:46 +00:00
#include "rust-ffi.hh"
extern "C" std::exception_ptr * make_error(rust::StringSlice s)
{
return new std::exception_ptr(std::make_exception_ptr(nix::Error(std::string(s.ptr, s.size))));
}
2019-12-13 18:05:09 +00:00
extern "C" void destroy_error(std::exception_ptr * ex)
{
free(ex);
}
namespace rust {
std::ostream & operator << (std::ostream & str, const String & s)
{
str << (std::string_view) s;
return str;
}
}
#endif