mirror of
https://github.com/cesanta/mongoose.git
synced 2025-01-14 09:48:01 +08:00
PATH_MAX -> MG_PATH_MAX
This commit is contained in:
parent
e8289ec17d
commit
4246f5d206
@ -1186,7 +1186,7 @@ static int p_stat(const char *path, size_t *size, time_t *mtime) {
|
||||
#else
|
||||
#if MG_ARCH == MG_ARCH_WIN32
|
||||
struct _stati64 st;
|
||||
wchar_t tmp[PATH_MAX];
|
||||
wchar_t tmp[MG_PATH_MAX];
|
||||
MultiByteToWideChar(CP_UTF8, 0, path, -1, tmp, sizeof(tmp) / sizeof(tmp[0]));
|
||||
if (_wstati64(tmp, &st) != 0) return 0;
|
||||
#else
|
||||
@ -1327,7 +1327,7 @@ static void p_list(const char *dir, void (*fn)(const char *, void *),
|
||||
static void *p_open(const char *path, int flags) {
|
||||
const char *mode = flags == MG_FS_READ ? "rb" : "a+b";
|
||||
#if MG_ARCH == MG_ARCH_WIN32
|
||||
wchar_t b1[PATH_MAX], b2[10];
|
||||
wchar_t b1[MG_PATH_MAX], b2[10];
|
||||
MultiByteToWideChar(CP_UTF8, 0, path, -1, b1, sizeof(b1) / sizeof(b1[0]));
|
||||
MultiByteToWideChar(CP_UTF8, 0, mode, -1, b2, sizeof(b2) / sizeof(b2[0]));
|
||||
return (void *) _wfopen(b1, b2);
|
||||
|
@ -17,7 +17,7 @@ static int p_stat(const char *path, size_t *size, time_t *mtime) {
|
||||
#else
|
||||
#if MG_ARCH == MG_ARCH_WIN32
|
||||
struct _stati64 st;
|
||||
wchar_t tmp[PATH_MAX];
|
||||
wchar_t tmp[MG_PATH_MAX];
|
||||
MultiByteToWideChar(CP_UTF8, 0, path, -1, tmp, sizeof(tmp) / sizeof(tmp[0]));
|
||||
if (_wstati64(tmp, &st) != 0) return 0;
|
||||
#else
|
||||
@ -158,7 +158,7 @@ static void p_list(const char *dir, void (*fn)(const char *, void *),
|
||||
static void *p_open(const char *path, int flags) {
|
||||
const char *mode = flags == MG_FS_READ ? "rb" : "a+b";
|
||||
#if MG_ARCH == MG_ARCH_WIN32
|
||||
wchar_t b1[PATH_MAX], b2[10];
|
||||
wchar_t b1[MG_PATH_MAX], b2[10];
|
||||
MultiByteToWideChar(CP_UTF8, 0, path, -1, b1, sizeof(b1) / sizeof(b1[0]));
|
||||
MultiByteToWideChar(CP_UTF8, 0, mode, -1, b2, sizeof(b2) / sizeof(b2[0]));
|
||||
return (void *) _wfopen(b1, b2);
|
||||
|
Loading…
x
Reference in New Issue
Block a user