From 547cbe578dcdb5aa5cfdac1cdb327f92bad21219 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Tue, 26 Jul 2022 19:27:35 +0200 Subject: Remove ANSI compatibility. Even though it is a fun challange in many ways, I think that, realistically, it is probably not worth the complexity. The Prolog backend isn't ANSI-compatible either. --- c/pl.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'c/pl.cpp') diff --git a/c/pl.cpp b/c/pl.cpp index a1849db..0114454 100644 --- a/c/pl.cpp +++ b/c/pl.cpp @@ -77,21 +77,11 @@ int Query::NextSolution() return 0; } -/* Convert Prolog term to normal or wide characters. */ -template <> -int PlString(const term_t t, std::string* const pStr, const int iFlags) +/* Convert Prolog term to wide characters. */ +int PlString(const term_t t, std::wstring* const pWstr, const int iFlags) { char* sz; int r = PL_get_chars(t, &sz, iFlags); - if (r) *pStr = sz; - return r; -} - -template <> -int PlString(const term_t t, std::wstring* const pWstr, const int iFlags) -{ - char* sz; - int r = PL_get_chars(t, &sz, iFlags); - if (r) *pWstr = BstrFromSz(sz); + if (r) *pWstr = WstrFromSz(sz); return r; } -- cgit v1.2.3