summaryrefslogtreecommitdiff
path: root/src/skel/crossplatform.cpp
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2020-10-02 17:36:56 +0300
committereray orçunus <erayorcunus@gmail.com>2020-10-02 21:18:34 +0300
commit3bd333022778cee8dd95b58b02a7263870546c1b (patch)
treec75422bd786b704644e9944cca012397cee0d897 /src/skel/crossplatform.cpp
parentee3f5744f52d7776cc9ce22db1788aa94e011203 (diff)
Load and write our settings in re3.ini & fixes
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) {