more unicode fixes

This commit is contained in:
Brad Parker 2016-12-02 22:12:00 -05:00
parent cc7bf6b4fa
commit fcf09f10ef
3 changed files with 16 additions and 2 deletions

View File

@ -76,7 +76,9 @@ dylib_t dylib_load(const char *path)
lib = LoadLibrary(path_wide);
free(path_wide);
if (path_wide)
free(path_wide);
SetErrorMode(prevmode);
if (!lib)
@ -84,6 +86,7 @@ dylib_t dylib_load(const char *path)
set_dl_error();
return NULL;
}
last_dyn_error[0] = 0;
#else
dylib_t lib = dlopen(path, RTLD_LAZY);

View File

@ -25,6 +25,7 @@
#include <string.h>
#include <errno.h>
#include <encodings/win32.h>
#include <tchar.h>
#include <retro_miscellaneous.h>
#if defined(_WIN32)
@ -196,7 +197,16 @@ bool mkdir_norecurse(const char *dir)
{
int ret;
#if defined(_WIN32)
#ifdef _MSC_VER
CHAR_TO_WCHAR_ALLOC(dir, dir_wide)
ret = _tmkdir(dir_wide);
if (dir_wide)
free(dir_wide);
#else
ret = _mkdir(dir);
#endif
#elif defined(IOS)
ret = mkdir(dir, 0755);
#elif defined(VITA) || defined(PSP)

View File

@ -27,6 +27,7 @@
#if defined(_WIN32)
#include <encodings/win32.h>
#include <tchar.h>
# ifdef _MSC_VER
# define setmode _setmode
# endif
@ -210,7 +211,7 @@ RFILE *filestream_open(const char *path, unsigned mode, ssize_t len)
{
#ifdef _WIN32
CHAR_TO_WCHAR_ALLOC(path, path_wide)
stream->fp = _wfopen(path_wide, mode_str);
stream->fp = _tfopen(path_wide, mode_str);
if (path_wide)
free(path_wide);