]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
fundamental: Move declaration of free() to macro-fundamental.h
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 23 May 2025 11:32:52 +0000 (13:32 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 24 May 2025 18:57:05 +0000 (20:57 +0200)
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.

src/fundamental/iovec-util-fundamental.h
src/fundamental/macro-fundamental.h

index 4c86197e6f7c49341d7ca50a9f27a4328054e12a..024dd9bf78ca63bfc8e454563f383852b763a132 100644 (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 */
index 6a75d7864a9b6de5c365dbbd45a39bbcd3f6cdfb..69bbeead48356c683ece9b016087ab59fc46c27b 100644 (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);                   \