[RFC PATCH] build: Move autodestruct macro definition
Denis Kenzior <[email protected]> Thu, 1 Feb 2024 10:19:46 -0600
| Newsgroups | dev.linux.lists.ell |
|---|---|
| Message-ID | <[email protected]> |
_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