diff options
-rw-r--r-- | c/common.cpp | 20 | ||||
-rw-r--r-- | c/common.h | 3 |
2 files changed, 0 insertions, 23 deletions
diff --git a/c/common.cpp b/c/common.cpp index c7ea873..02feecf 100644 --- a/c/common.cpp +++ b/c/common.cpp @@ -1,27 +1,7 @@ -#include <stdexcept> -#include <memory> #include <windows.h> -#include <SWI-Prolog.h> #include "common.h" -/* Convert normal string to TSTR using given codepage. */ -std::basic_string<TCHAR> TsmFromSz(const char *sz, int iCp) -{ -#ifdef UNICODE - int cbMultiByte, cchWideChar; - - cbMultiByte = strlen(sz)+1; - cchWideChar = MultiByteToWideChar(iCp, 0, sz, cbMultiByte, NULL, 0); - std::wstring wsm(cchWideChar, 0); - if (!MultiByteToWideChar(iCp, 0, sz, cbMultiByte, wsm.data(), cchWideChar)) - throw Win32Error(GetLastError()); - return wsm; -#else - return std::string(sz); -#endif -} - Win32Error::Win32Error(DWORD dwErr) { m_dwErr = dwErr; @@ -3,7 +3,6 @@ #include <memory> #include <optional> -#include <stdexcept> #include <windows.h> #ifdef UNICODE @@ -12,8 +11,6 @@ #define WA "A" #endif -std::basic_string<TCHAR> TsmFromSz(const char *, int); - struct Win32Error : public std::exception { Win32Error(DWORD); |