Fix docs, nits to freertos includes

This commit is contained in:
cpq 2022-08-14 23:46:33 +01:00
parent 6b69bef2ef
commit 6ad7af54dc
4 changed files with 9 additions and 13 deletions

View File

@ -2682,7 +2682,7 @@ char *msg = mg_mprintf("Double quoted string: %Q!", "hi");
free(msg);
```
### mg\_rprintf(), mg\_vrprintf()
### mg\_xprintf(), mg\_vxprintf()
```c
size_t mg_xprintf(void (*out)(char, void *), void *param, const char *fmt, ...);

View File

@ -168,6 +168,7 @@ extern "C" {
#include <ctype.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
@ -201,17 +202,12 @@ static inline void *mg_calloc(int cnt, size_t size) {
#define calloc(a, b) mg_calloc((a), (b))
#define free(a) vPortFree(a)
#define malloc(a) pvPortMalloc(a)
#define mkdir(a, b) (-1)
#ifndef MG_IO_SIZE
#define MG_IO_SIZE 512
#endif
#ifndef MG_PATH_MAX
#define MG_PATH_MAX 128
#endif
#endif // MG_ARCH == MG_ARCH_FREERTOS_LWIP
@ -230,9 +226,11 @@ static inline void *mg_calloc(int cnt, size_t size) {
#include <time.h>
#include <FreeRTOS.h>
#include <list.h>
#include <task.h>
#include <FreeRTOS_IP.h>
#include <FreeRTOS_Sockets.h>
#include <task.h>
// Why FreeRTOS-TCP did not implement a clean BSD API, but its own thing
// with FreeRTOS_ prefix, is beyond me

View File

@ -5,6 +5,7 @@
#include <ctype.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
@ -38,15 +39,10 @@ static inline void *mg_calloc(int cnt, size_t size) {
#define calloc(a, b) mg_calloc((a), (b))
#define free(a) vPortFree(a)
#define malloc(a) pvPortMalloc(a)
#define mkdir(a, b) (-1)
#ifndef MG_IO_SIZE
#define MG_IO_SIZE 512
#endif
#ifndef MG_PATH_MAX
#define MG_PATH_MAX 128
#endif
#endif // MG_ARCH == MG_ARCH_FREERTOS_LWIP

View File

@ -15,9 +15,11 @@
#include <time.h>
#include <FreeRTOS.h>
#include <list.h>
#include <task.h>
#include <FreeRTOS_IP.h>
#include <FreeRTOS_Sockets.h>
#include <task.h>
// Why FreeRTOS-TCP did not implement a clean BSD API, but its own thing
// with FreeRTOS_ prefix, is beyond me