diff options
author | Chris Robinson <[email protected]> | 2019-08-11 18:50:07 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-08-11 18:50:07 -0700 |
commit | e200569cd319448d12099f27a2713c69da382d26 (patch) | |
tree | 5475e5aa20505bd403b46053321dd2d6a019ac5d /alc | |
parent | 7118733458bc388a900677da6e0d4e4244d0f536 (diff) |
Move the wstr converters to a separate header
Diffstat (limited to 'alc')
-rw-r--r-- | alc/alc.cpp | 1 | ||||
-rw-r--r-- | alc/alconfig.cpp | 1 | ||||
-rw-r--r-- | alc/backends/dsound.cpp | 1 | ||||
-rw-r--r-- | alc/backends/wasapi.cpp | 1 | ||||
-rw-r--r-- | alc/backends/wave.cpp | 1 | ||||
-rw-r--r-- | alc/backends/winmm.cpp | 1 | ||||
-rw-r--r-- | alc/compat.h | 30 | ||||
-rw-r--r-- | alc/helpers.cpp | 1 |
8 files changed, 7 insertions, 30 deletions
diff --git a/alc/alc.cpp b/alc/alc.cpp index c1989913..adead648 100644 --- a/alc/alc.cpp +++ b/alc/alc.cpp @@ -85,6 +85,7 @@ #include "mastering.h" #include "opthelpers.h" #include "ringbuffer.h" +#include "strutils.h" #include "threads.h" #include "uhjfilter.h" #include "vecmat.h" diff --git a/alc/alconfig.cpp b/alc/alconfig.cpp index e7632ef7..f6190b58 100644 --- a/alc/alconfig.cpp +++ b/alc/alconfig.cpp @@ -47,6 +47,7 @@ #include "alcmain.h" #include "logging.h" +#include "strutils.h" #include "compat.h" diff --git a/alc/backends/dsound.cpp b/alc/backends/dsound.cpp index b9e52c0c..ad182cf7 100644 --- a/alc/backends/dsound.cpp +++ b/alc/backends/dsound.cpp @@ -49,6 +49,7 @@ #include "ringbuffer.h" #include "compat.h" #include "dynload.h" +#include "strutils.h" #include "threads.h" /* MinGW-w64 needs this for some unknown reason now. */ diff --git a/alc/backends/wasapi.cpp b/alc/backends/wasapi.cpp index bd009463..cc53be66 100644 --- a/alc/backends/wasapi.cpp +++ b/alc/backends/wasapi.cpp @@ -59,6 +59,7 @@ #include "ringbuffer.h" #include "compat.h" #include "converter.h" +#include "strutils.h" #include "threads.h" diff --git a/alc/backends/wave.cpp b/alc/backends/wave.cpp index 6ca2fab4..aa4130af 100644 --- a/alc/backends/wave.cpp +++ b/alc/backends/wave.cpp @@ -43,6 +43,7 @@ #include "compat.h" #include "endiantest.h" #include "logging.h" +#include "strutils.h" #include "threads.h" #include "vector.h" diff --git a/alc/backends/winmm.cpp b/alc/backends/winmm.cpp index cd32e95b..b6787a24 100644 --- a/alc/backends/winmm.cpp +++ b/alc/backends/winmm.cpp @@ -40,6 +40,7 @@ #include "alcmain.h" #include "alu.h" #include "ringbuffer.h" +#include "strutils.h" #include "threads.h" #include "compat.h" diff --git a/alc/compat.h b/alc/compat.h index 648fa5b1..f2e10513 100644 --- a/alc/compat.h +++ b/alc/compat.h @@ -10,36 +10,6 @@ #include <string> #include <fstream> -inline std::string wstr_to_utf8(const WCHAR *wstr) -{ - std::string ret; - - int len = WideCharToMultiByte(CP_UTF8, 0, wstr, -1, nullptr, 0, nullptr, nullptr); - if(len > 0) - { - ret.resize(len); - WideCharToMultiByte(CP_UTF8, 0, wstr, -1, &ret[0], len, nullptr, nullptr); - ret.pop_back(); - } - - return ret; -} - -inline std::wstring utf8_to_wstr(const char *str) -{ - std::wstring ret; - - int len = MultiByteToWideChar(CP_UTF8, 0, str, -1, NULL, 0); - if(len > 0) - { - ret.resize(len); - MultiByteToWideChar(CP_UTF8, 0, str, -1, &ret[0], len); - ret.pop_back(); - } - - return ret; -} - namespace al { diff --git a/alc/helpers.cpp b/alc/helpers.cpp index b952c5ed..27219b03 100644 --- a/alc/helpers.cpp +++ b/alc/helpers.cpp @@ -106,6 +106,7 @@ DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_GUID, 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x #include "cpu_caps.h" #include "fpu_modes.h" #include "logging.h" +#include "strutils.h" #include "vector.h" |