summaryrefslogtreecommitdiff
path: root/src/skel/crossplatform.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-10-05 16:10:26 +0300
committerNikolay Korolev <nickvnuk@gmail.com>2020-10-05 16:10:26 +0300
commit6853be36c8bd293c8ee0b18cd411fc5a3ebe1099 (patch)
tree813ff9d66382eea57625ec5cb2ca1872d12d7113 /src/skel/crossplatform.cpp
parent2bfb54b192c54ee30be046b016ee10476fc73144 (diff)
parent9db0d7bba14815a5f101c317b9ac2b0bae21d78b (diff)
Merge remote-tracking branch 'upstream/master'
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) {