mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
windows: import tronkko's dirent.h
Win32 compatible version of dirent.h microsoft just don't seem to be able to include themselves. MIT license, same as lws, link to original github project in the header
This commit is contained in:
parent
d3308df40f
commit
d7294a714e
3 changed files with 1171 additions and 7 deletions
|
@ -129,7 +129,7 @@ option(LWS_WITH_STRUCT_JSON "Generic struct serialization to and from JSON" OFF)
|
|||
option(LWS_WITH_STRUCT_SQLITE3 "Generic struct serialization to and from SQLITE3" OFF)
|
||||
# broken atm
|
||||
#option(LWS_WITH_SMTP "Provide SMTP support" OFF)
|
||||
if (WIN32 OR LWS_WITH_ESP32)
|
||||
if (LWS_WITH_ESP32)
|
||||
option(LWS_WITH_DIR "Directory scanning api support" OFF)
|
||||
option(LWS_WITH_LEJP_CONF "With LEJP configuration parser as used by lwsws" OFF)
|
||||
else()
|
||||
|
@ -151,7 +151,6 @@ option(LWS_WITH_LWSAC "lwsac Chunk Allocation api" ON)
|
|||
option(LWS_WITH_CUSTOM_HEADERS "Store and allow querying custom HTTP headers (H1 only)" ON)
|
||||
option(LWS_WITH_DISKCACHE "Hashed cache directory with lazy LRU deletion to size limit" OFF)
|
||||
option(LWS_WITH_ASAN "Build with gcc runtime sanitizer options enabled (needs libasan)" OFF)
|
||||
option(LWS_WITH_DIR "Directory scanning api support" OFF)
|
||||
option(LWS_WITH_LEJP_CONF "With LEJP configuration parser as used by lwsws" OFF)
|
||||
option(LWS_WITH_ZLIB "Include zlib support (required for extensions)" OFF)
|
||||
option(LWS_WITH_BUNDLED_ZLIB "Use bundled zlib version (Windows only)" ${LWS_WITH_BUNDLED_ZLIB_DEFAULT})
|
||||
|
@ -192,7 +191,7 @@ if (LWS_PLAT_FREERTOS OR LWS_PLAT_OPTEE)
|
|||
set(LWS_WITH_UDP 0)
|
||||
endif()
|
||||
|
||||
if (WIN32 OR LWS_PLAT_FREERTOS)
|
||||
if (LWS_PLAT_FREERTOS)
|
||||
message(STATUS "No LWS_WITH_DIR or LWS_WITH_LEJP_CONF")
|
||||
set(LWS_WITH_DIR OFF)
|
||||
set(LWS_WITH_LEJP_CONF OFF)
|
||||
|
|
|
@ -78,9 +78,13 @@ bail:
|
|||
|
||||
#else
|
||||
|
||||
#if !defined(_WIN32) && !defined(LWS_PLAT_FREERTOS)
|
||||
#if !defined(LWS_PLAT_FREERTOS)
|
||||
|
||||
#if defined(WIN32)
|
||||
#include "../../win32port/dirent/dirent-win32.h"
|
||||
#else
|
||||
#include <dirent.h>
|
||||
#endif
|
||||
|
||||
static int filter(const struct dirent *ent)
|
||||
{
|
||||
|
@ -153,15 +157,19 @@ lws_dir(const char *dirpath, void *user, lws_dir_callback_function cb)
|
|||
case DT_FIFO:
|
||||
lde.type = LDOT_FIFO;
|
||||
break;
|
||||
#if !defined(WIN32)
|
||||
case DT_LNK:
|
||||
lde.type = LDOT_LINK;
|
||||
break;
|
||||
#endif
|
||||
case DT_REG:
|
||||
lde.type = LDOT_FILE;
|
||||
break;
|
||||
#if !defined(WIN32)
|
||||
case DT_SOCK:
|
||||
lde.type = LDOTT_SOCKET;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
lde.type = LDOT_UNKNOWN;
|
||||
break;
|
||||
|
@ -183,8 +191,5 @@ bail:
|
|||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#else
|
||||
#error "If you want lws_dir on windows, you need libuv"
|
||||
#endif
|
||||
#endif
|
||||
|
|
1160
win32port/dirent/dirent-win32.h
Normal file
1160
win32port/dirent/dirent-win32.h
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue