aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--c/common.cpp20
-rw-r--r--c/common.h3
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;
diff --git a/c/common.h b/c/common.h
index 4b28360..76f3d6e 100644
--- a/c/common.h
+++ b/c/common.h
@@ -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);