Commit 7fdb5080 authored by Deomid Ryabkov's avatar Deomid Ryabkov Committed by rojer

Resolve *dir function decl conflict on Win32

We used to declare these functions twice: in plaform_windows.h
and cs_dirent.h. Removed decl from platform_windows.h and moved
cs_dirent.h to be privately included by mongoose.c

PUBLISHED_FROM=ab62370409e29e3c62a8b8eab0f75795b5d7ed0f
parent 890c7b42
...@@ -386,6 +386,61 @@ void cs_log_set_level(enum cs_log_level level) { ...@@ -386,6 +386,61 @@ void cs_log_set_level(enum cs_log_level level) {
#endif #endif
} }
#ifdef MG_MODULE_LINES #ifdef MG_MODULE_LINES
#line 1 "./src/../../common/cs_dirent.h"
#endif
/*
* Copyright (c) 2014-2016 Cesanta Software Limited
* All rights reserved
*/
#ifndef CS_COMMON_CS_DIRENT_H_
#define CS_COMMON_CS_DIRENT_H_
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#ifdef CS_ENABLE_SPIFFS
#include <spiffs.h>
typedef struct {
spiffs_DIR dh;
struct spiffs_dirent de;
} DIR;
#define d_name name
#define dirent spiffs_dirent
int rmdir(const char *path);
int mkdir(const char *path, mode_t mode);
#endif
#if defined(_WIN32)
struct dirent {
char d_name[MAX_PATH];
};
typedef struct DIR {
HANDLE handle;
WIN32_FIND_DATAW info;
struct dirent result;
} DIR;
#endif
#if defined(_WIN32) || defined(CS_ENABLE_SPIFFS)
DIR *opendir(const char *dir_name);
int closedir(DIR *dir);
struct dirent *readdir(DIR *dir);
#endif
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* CS_COMMON_CS_DIRENT_H_ */
#ifdef MG_MODULE_LINES
#line 1 "./src/../../common/cs_dirent.c" #line 1 "./src/../../common/cs_dirent.c"
#endif #endif
/* /*
......
...@@ -224,21 +224,6 @@ typedef struct _stati64 cs_stat_t; ...@@ -224,21 +224,6 @@ typedef struct _stati64 cs_stat_t;
#endif #endif
#define DIRSEP '\\' #define DIRSEP '\\'
/* POSIX opendir/closedir/readdir API for Windows. */
struct dirent {
char d_name[MAX_PATH];
};
typedef struct DIR {
HANDLE handle;
WIN32_FIND_DATAW info;
struct dirent result;
} DIR;
DIR *opendir(const char *name);
int closedir(DIR *dir);
struct dirent *readdir(DIR *dir);
#ifndef va_copy #ifndef va_copy
#ifdef __va_copy #ifdef __va_copy
#define va_copy __va_copy #define va_copy __va_copy
...@@ -1112,46 +1097,6 @@ int json_emit_va(char *buf, int buf_len, const char *fmt, va_list); ...@@ -1112,46 +1097,6 @@ int json_emit_va(char *buf, int buf_len, const char *fmt, va_list);
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* CS_MONGOOSE_DEPS_FROZEN_FROZEN_H_ */ #endif /* CS_MONGOOSE_DEPS_FROZEN_FROZEN_H_ */
/*
* Copyright (c) 2014-2016 Cesanta Software Limited
* All rights reserved
*/
#ifndef CS_COMMON_CS_DIRENT_H_
#define CS_COMMON_CS_DIRENT_H_
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#ifdef CS_ENABLE_SPIFFS
#include <spiffs.h>
typedef struct {
spiffs_DIR dh;
struct spiffs_dirent de;
} DIR;
#define d_name name
#define dirent spiffs_dirent
int rmdir(const char *path);
int mkdir(const char *path, mode_t mode);
#endif
#if defined(_WIN32) || defined(CS_ENABLE_SPIFFS)
DIR *opendir(const char *dir_name);
int closedir(DIR *dir);
struct dirent *readdir(DIR *dir);
#endif
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* CS_COMMON_CS_DIRENT_H_ */
/* /*
* Copyright (c) 2014 Cesanta Software Limited * Copyright (c) 2014 Cesanta Software Limited
* All rights reserved * All rights reserved
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment