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
This commit is contained in:
Deomid Ryabkov 2016-04-22 18:12:42 +03:00 committed by rojer
parent 890c7b42dc
commit 7fdb50807c
2 changed files with 55 additions and 55 deletions

View File

@ -386,6 +386,61 @@ void cs_log_set_level(enum cs_log_level level) {
#endif
}
#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"
#endif
/*

View File

@ -224,21 +224,6 @@ typedef struct _stati64 cs_stat_t;
#endif
#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
#ifdef __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);
#endif /* __cplusplus */
#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
* All rights reserved