build: Move autodestruct macro definition
RFC PATCH 1/1 build: Move autodestruct macro definition
_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(-)
configure.ac +2 -0
@@ -150,4 +150,6 @@ AC_SUBST(OPENSSL_PROVIDER) AC_CONFIG_FILES(Makefile ell/ell.pc) +AC_DEFINE([_auto_], [__L_AUTODESTRUCT], [autodestruct syntax]) + AC_OUTPUT
ell/useful.h +0 -3
@@ -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
Signature · 1 line
2.43.0