public inbox for ell@lists.linux.dev
 help / color / mirror / Atom feed
* [RFC PATCH] build: Move autodestruct macro definition
@ 2024-02-01 16:19 Denis Kenzior
  0 siblings, 0 replies; only message in thread
From: Denis Kenzior @ 2024-02-01 16:19 UTC (permalink / raw)
  To: ell; +Cc: Denis Kenzior

_auto_ syntax is widely used by ell and iwd, however it isn't part of
the public ell API.  Currently it is defined in ell/useful.h, but this
header isn't distributed with other public ell headers.  iwd has special
hacks in its build system to enable use of useful.h, but this may not be
sustainable if multiple ell based projects would like to use this
facility.

Move the _auto_ macro definition out of useful.h and into the build
system.  Any project can thus enable the _auto_ syntax by adding a 1
liner to 'configure.ac'
---
 configure.ac | 2 ++
 ell/useful.h | 3 ---
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 0dd569570a75..8d88f1c2a022 100644
--- a/configure.ac
+++ b/configure.ac
@@ -150,4 +150,6 @@ AC_SUBST(OPENSSL_PROVIDER)
 
 AC_CONFIG_FILES(Makefile ell/ell.pc)
 
+AC_DEFINE([_auto_], [__L_AUTODESTRUCT], [autodestruct syntax])
+
 AC_OUTPUT
diff --git a/ell/useful.h b/ell/useful.h
index ab88f52556f5..a3d5ad916bd8 100644
--- a/ell/useful.h
+++ b/ell/useful.h
@@ -59,9 +59,6 @@ static inline unsigned char bit_field(const unsigned char oct,
 	_x / _d;					\
 })
 
-#define _auto_(func)					\
-	__L_AUTODESTRUCT(func)
-
 /*
  * Trick the compiler into thinking that var might be changed somehow by
  * the asm
-- 
2.43.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-02-01 16:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-01 16:19 [RFC PATCH] build: Move autodestruct macro definition Denis Kenzior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox