mirror of
https://github.com/mborgerson/xemu.git
synced 2025-12-01 16:10:01 +00:00
util/oslib-win32: Use UTF-16 filesystem API
* Introduces qemu_fopen, qemu_access wrappers, and modifies qemu_open to support converting stored UTF-8 paths to UTF-16 to use Unicode filesystem API on Windows platform. * Migrates several native open, fopen, and access calls to their qemu_* counterparts to resolve Unicode path handling issues on Windows.
This commit is contained in:
@ -593,6 +593,21 @@ int qemu_lock_fd_test(int fd, int64_t start, int64_t len, bool exclusive);
|
||||
bool qemu_has_ofd_lock(void);
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
FILE *qemu_fopen(const char *filename, const char *mode);
|
||||
int qemu_access(const char *pathname, int mode);
|
||||
#else
|
||||
static inline FILE *qemu_fopen(const char *filename, const char *mode)
|
||||
{
|
||||
return fopen(filename, mode);
|
||||
}
|
||||
|
||||
static inline int qemu_access(const char *pathname, int mode)
|
||||
{
|
||||
return access(pathname, mode);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__HAIKU__) && defined(__i386__)
|
||||
#define FMT_pid "%ld"
|
||||
#elif defined(WIN64)
|
||||
|
||||
Reference in New Issue
Block a user