fundamental: Move declaration of free() to macro-fundamental.h

Let's put it together with the macro that needs it (mfree()). Also,
get rid of the unnecessary <stdlib.h> include in iovec-util-fundamental.h.
This commit is contained in:
Daan De Meyer
2025-05-23 13:32:52 +02:00
parent 34269a6398
commit a119c648f8
2 changed files with 4 additions and 5 deletions

View File

@@ -2,7 +2,6 @@
#pragma once
#if !SD_BOOT
#include <stdlib.h>
#include <sys/uio.h>
#endif
@@ -15,10 +14,6 @@ struct iovec {
void *iov_base;
size_t iov_len;
};
DISABLE_WARNING_REDUNDANT_DECLS;
void free(void *p);
REENABLE_WARNING;
#endif
/* This accepts both const and non-const pointers */

View File

@@ -396,6 +396,10 @@ assert_cc(sizeof(long long) == sizeof(intmax_t));
*/
#define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0])))
DISABLE_WARNING_REDUNDANT_DECLS;
void free(void *p);
REENABLE_WARNING;
#define mfree(memory) \
({ \
free(memory); \