diff options
Diffstat (limited to 'c/main.cpp')
-rw-r--r-- | c/main.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -64,9 +64,9 @@ void OnTerminate() noexcept try { std::rethrow_exception(std::current_exception()); } catch (const term_t& t) { - TCHAR* tsz; - if (PL_get_tchars(t, &tsz, CVT_WRITE)) - TerminateMsg<TCHAR>(TEXT("a Prolog exception"), tsz); + std::basic_string<TCHAR> tstr; + if (PlString(t, &tstr)) + TerminateMsg<TCHAR>(TEXT("a Prolog exception"), tstr.c_str()); else TerminateMsg<char>("a Prolog exception", NULL); } catch (const Win32Error& e) { |