diff --git a/mongoose.c b/mongoose.c index 5c5900e52ce64efe0a48d316192f2a2155723323..4903ecb3ac56d2d69a19cae97310b7940265933a 100644 --- a/mongoose.c +++ b/mongoose.c @@ -15726,3 +15726,23 @@ const struct mg_iface_vtable mg_default_iface_vtable = MG_PIC32_IFACE_VTABLE; #endif #endif /* MG_ENABLE_NET_IF_PIC32 */ +#ifdef MG_MODULE_LINES +#line 1 "common/platforms/windows/windows_direct.c" +#endif +/* + * Copyright (c) 2017 Cesanta Software Limited + * All rights reserved + */ + +#ifdef _WIN32 + +int rmdir(const char *dirname) { + return _rmdir(dirname); +} + +unsigned int sleep(unsigned int seconds) { + Sleep(seconds * 1000); + return 0; +} + +#endif /* _WIN32 */ diff --git a/mongoose.h b/mongoose.h index 819dd80b41c9e023ccbd36e2ac4f4033c4498a6b..d21f3c548215cf76b16d4ac1a78105d6df447301 100644 --- a/mongoose.h +++ b/mongoose.h @@ -223,14 +223,12 @@ #endif #define snprintf _snprintf #define vsnprintf _vsnprintf -#define sleep(x) Sleep((x) *1000) #define to64(x) _atoi64(x) #if !defined(__MINGW32__) && !defined(__MINGW64__) #define popen(x, y) _popen((x), (y)) #define pclose(x) _pclose(x) #define fileno _fileno #endif -#define rmdir _rmdir #if defined(_MSC_VER) && _MSC_VER >= 1400 #define fseeko(x, y, z) _fseeki64((x), (y), (z)) #else @@ -321,6 +319,9 @@ typedef struct _stati64 cs_stat_t; #define MG_NET_IF MG_NET_IF_SOCKET #endif +int rmdir(const char *dirname); +unsigned int sleep(unsigned int seconds); + #endif /* CS_PLATFORM == CS_P_WINDOWS */ #endif /* CS_COMMON_PLATFORMS_PLATFORM_WINDOWS_H_ */ #ifdef MG_MODULE_LINES