From: Max Resch Date: Mon, 11 Oct 2021 23:26:00 +0000 (+0200) Subject: move mfree to macro-fundamentals.h X-Git-Tag: v250-rc1~500^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=200b1d997d96179aba9489ce9d373e869557460e;p=thirdparty%2Fsystemd.git move mfree to macro-fundamentals.h --- diff --git a/src/basic/alloc-util.h b/src/basic/alloc-util.h index e587fe79e7a..a6429be78f5 100644 --- a/src/basic/alloc-util.h +++ b/src/basic/alloc-util.h @@ -44,12 +44,6 @@ typedef void (*free_func_t)(void *p); #define malloc0(n) (calloc(1, (n) ?: 1)) -#define mfree(memory) \ - ({ \ - free(memory); \ - (typeof(memory)) NULL; \ - }) - #define free_and_replace(a, b) \ ({ \ typeof(a)* _a = &(a); \ diff --git a/src/fundamental/macro-fundamental.h b/src/fundamental/macro-fundamental.h index 7fa4b85be7f..940b661b0e5 100644 --- a/src/fundamental/macro-fundamental.h +++ b/src/fundamental/macro-fundamental.h @@ -61,6 +61,7 @@ #endif #define memcpy(a, b, c) CopyMem((a), (b), (c)) + #define free(a) FreePool(a) #endif #if defined(static_assert) @@ -266,3 +267,9 @@ * @x: a string literal. */ #define STRLEN(x) (sizeof(""x"") - sizeof(typeof(x[0]))) + +#define mfree(memory) \ + ({ \ + free(memory); \ + (typeof(memory)) NULL; \ + })