Pass string_view instead of const char* to callback functions

This commit is contained in:
King_DuckZ 2022-04-28 22:55:22 +02:00
commit 6f4b0ce094
7 changed files with 63 additions and 42 deletions

View file

@ -20,11 +20,11 @@
#include <algorithm>
namespace wren {
void DefConfiguration::write_fn (VM*, const char* text) {
void DefConfiguration::write_fn (VM*, wren_string_t text) {
std::cout << text;
}
void DefConfiguration::error_fn (VM*, ErrorType type, const char* module, int line, const char* message) {
void DefConfiguration::error_fn (VM*, ErrorType type, wren_string_t module, int line, wren_string_t message) {
std::cerr << "Wren error: " << message << " in " << module << ':' << line << '\n';
}