Nits to have tests pass

This commit is contained in:
cpq committed 2021-05-12 09:25:21 +01:00
1 parent 2b836504ab
commit a98e980c8f
7 files changed
+12 -16

No files matched your search

+1 -1
View File
@@ -41,6 +41,6 @@
#include "arch_esp32.h"
#include "arch_esp8266.h"
#include "arch_freertos.h"
#include "arch_freertos_tcp.h"
#include "arch_unix.h"
#include "arch_win32.h"
-3
View File
@@ -37,9 +37,6 @@
#define SO_REUSEADDR 0
#define sockaddr_in freertos_sockaddr
#define sockaddr freertos_sockaddr
// struct sockaddr {
// uint8_t sa_len, sa_family;
// };
#define accept(a, b, c) FreeRTOS_accept((a), (b), (c))
#define connect(a, b, c) FreeRTOS_connect((a), (b), (c))
#define bind(a, b, c) FreeRTOS_bind((a), (b), (c))
+3 -2
View File
@@ -124,8 +124,9 @@ void mg_mgr_free(struct mg_mgr *mgr) {
void mg_mgr_init(struct mg_mgr *mgr) {
memset(mgr, 0, sizeof(*mgr));
#if defined(_WIN32) && MG_ENABLE_WINSOCK
WSADATA data;
WSAStartup(MAKEWORD(2, 2), &data);
// clang-format off
{ WSADATA data; WSAStartup(MAKEWORD(2, 2), &data); }
// clang-format on
#elif MG_ARCH == MG_ARCH_FREERTOS_TCP
mgr->ss = FreeRTOS_CreateSocketSet();
#elif defined(__unix) || defined(__unix__) || defined(__APPLE__)
+3 -2
View File
@@ -1,5 +1,6 @@
#include "config.h" // Must go first - important for test++
#include "util.h"
#include "config.h"
#if MG_ENABLE_FS
int mg_stat(const char *path, mg_stat_t *st) {
@@ -84,7 +85,7 @@ bool mg_file_printf(const char *path, const char *fmt, ...) {
if (buf != tmp) free(buf);
return result;
}
#endif
#endif // MG_ENABLE_FS
void mg_random(void *buf, size_t len) {
bool done = false;
-1
View File
@@ -82,4 +82,3 @@ FILE *mg_fopen(const char *fp, const char *mode);
while (*h != (elem_)) h = &(*h)->next; \
*h = (elem_)->next; \
} while (0)