| Index: compiled/tools.cpp |
| =================================================================== |
| new file mode 100644 |
| --- /dev/null |
| +++ b/compiled/tools.cpp |
| @@ -0,0 +1,19 @@ |
| +#include "tools.h" |
| + |
| +char16_t* stringToBuffer(const std::u16string& str, size_t* resultLen) |
| +{ |
| + size_t length = str.length(); |
| + char16_t* buffer = new char16_t[length]; |
| + str.copy(buffer, length, 0); |
| + *resultLen = length; |
| + return buffer; |
| +} |
| + |
| +// API |
| +extern "C" |
| +{ |
| + const char* EMSCRIPTEN_KEEPALIVE getException(const std::exception& e) |
| + { |
| + return e.what(); |
| + } |
| +} |