summaryrefslogtreecommitdiffstats
path: root/src/skel/crossplatform.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-10-11 11:58:11 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-10-11 11:58:11 +0200
commit552f308e9e0a745852ca11064b6b31e16b115917 (patch)
treea88d109962a7de5594f3781fe1e388879936218c /src/skel/crossplatform.cpp
parentControl updates (diff)
parentMerge pull request #760 from Sergeanur/VC/TextFinish (diff)
downloadre3-552f308e9e0a745852ca11064b6b31e16b115917.tar
re3-552f308e9e0a745852ca11064b6b31e16b115917.tar.gz
re3-552f308e9e0a745852ca11064b6b31e16b115917.tar.bz2
re3-552f308e9e0a745852ca11064b6b31e16b115917.tar.lz
re3-552f308e9e0a745852ca11064b6b31e16b115917.tar.xz
re3-552f308e9e0a745852ca11064b6b31e16b115917.tar.zst
re3-552f308e9e0a745852ca11064b6b31e16b115917.zip
Diffstat (limited to 'src/skel/crossplatform.cpp')
-rw-r--r--src/skel/crossplatform.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/skel/crossplatform.cpp b/src/skel/crossplatform.cpp
index 6188992d..452ad9fa 100644
--- a/src/skel/crossplatform.cpp
+++ b/src/skel/crossplatform.cpp
@@ -84,6 +84,16 @@ void FileTimeToSystemTime(time_t* writeTime, SYSTEMTIME* out) {
}
#endif
+// Because wchar length differs between platforms.
+wchar*
+AllocUnicode(const char* src)
+{
+ wchar *dst = (wchar*)malloc(strlen(src)*2 + 2);
+ wchar *i = dst;
+ while((*i++ = (unsigned char)*src++) != '\0');
+ return dst;
+}
+
// Funcs/features from Windows that we need on other platforms
#ifndef _WIN32
char *strupr(char *s) {