mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
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:
@@ -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 */
|
||||
|
||||
@@ -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); \
|
||||
|
||||
Reference in New Issue
Block a user