public inbox for ell@lists.linux.dev
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ell@lists.linux.dev
Cc: Denis Kenzior <denkenz@gmail.com>
Subject: [RFC PATCH] build: Move autodestruct macro definition
Date: Thu,  1 Feb 2024 10:19:46 -0600	[thread overview]
Message-ID: <20240201162000.913015-1-denkenz@gmail.com> (raw)

_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


                 reply	other threads:[~2024-02-01 16:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240201162000.913015-1-denkenz@gmail.com \
    --to=denkenz@gmail.com \
    --cc=ell@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox