From da04598319bf3ab9d240bbec993222623a4ab85d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sun, 17 Jul 2022 00:55:11 +0200 Subject: Remove TsmFromSz. If needed in the future, it is possible to simply copy it from the Git history. --- c/common.cpp | 20 -------------------- c/common.h | 3 --- 2 files changed, 23 deletions(-) (limited to 'c') 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 -#include #include -#include #include "common.h" -/* Convert normal string to TSTR using given codepage. */ -std::basic_string 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 #include -#include #include #ifdef UNICODE @@ -12,8 +11,6 @@ #define WA "A" #endif -std::basic_string TsmFromSz(const char *, int); - struct Win32Error : public std::exception { Win32Error(DWORD); -- cgit v1.2.3