mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-24 20:21:49 +00:00
PATH_MAX -> MG_PATH_MAX
This commit is contained in:
1 parent
e8289ec17d
commit
4246f5d206
2 files changed
+4
-4
No files matched your search
+2
-2
@@ -1186,7 +1186,7 @@ static int p_stat(const char *path, size_t *size, time_t *mtime) {
|
|||||||
#else
|
#else
|
||||||
#if MG_ARCH == MG_ARCH_WIN32
|
#if MG_ARCH == MG_ARCH_WIN32
|
||||||
struct _stati64 st;
|
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]));
|
MultiByteToWideChar(CP_UTF8, 0, path, -1, tmp, sizeof(tmp) / sizeof(tmp[0]));
|
||||||
if (_wstati64(tmp, &st) != 0) return 0;
|
if (_wstati64(tmp, &st) != 0) return 0;
|
||||||
#else
|
#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) {
|
static void *p_open(const char *path, int flags) {
|
||||||
const char *mode = flags == MG_FS_READ ? "rb" : "a+b";
|
const char *mode = flags == MG_FS_READ ? "rb" : "a+b";
|
||||||
#if MG_ARCH == MG_ARCH_WIN32
|
#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, path, -1, b1, sizeof(b1) / sizeof(b1[0]));
|
||||||
MultiByteToWideChar(CP_UTF8, 0, mode, -1, b2, sizeof(b2) / sizeof(b2[0]));
|
MultiByteToWideChar(CP_UTF8, 0, mode, -1, b2, sizeof(b2) / sizeof(b2[0]));
|
||||||
return (void *) _wfopen(b1, b2);
|
return (void *) _wfopen(b1, b2);
|
||||||
|
|||||||
+2
-2
@@ -17,7 +17,7 @@ static int p_stat(const char *path, size_t *size, time_t *mtime) {
|
|||||||
#else
|
#else
|
||||||
#if MG_ARCH == MG_ARCH_WIN32
|
#if MG_ARCH == MG_ARCH_WIN32
|
||||||
struct _stati64 st;
|
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]));
|
MultiByteToWideChar(CP_UTF8, 0, path, -1, tmp, sizeof(tmp) / sizeof(tmp[0]));
|
||||||
if (_wstati64(tmp, &st) != 0) return 0;
|
if (_wstati64(tmp, &st) != 0) return 0;
|
||||||
#else
|
#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) {
|
static void *p_open(const char *path, int flags) {
|
||||||
const char *mode = flags == MG_FS_READ ? "rb" : "a+b";
|
const char *mode = flags == MG_FS_READ ? "rb" : "a+b";
|
||||||
#if MG_ARCH == MG_ARCH_WIN32
|
#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, path, -1, b1, sizeof(b1) / sizeof(b1[0]));
|
||||||
MultiByteToWideChar(CP_UTF8, 0, mode, -1, b2, sizeof(b2) / sizeof(b2[0]));
|
MultiByteToWideChar(CP_UTF8, 0, mode, -1, b2, sizeof(b2) / sizeof(b2[0]));
|
||||||
return (void *) _wfopen(b1, b2);
|
return (void *) _wfopen(b1, b2);
|
||||||
|
|||||||
Reference in new issue
Block a user