From 03f8544691a8de9f77a803fd8cd2eeadb919ec03 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sun, 10 Dec 2023 00:39:16 +0100 Subject: Genesis commit --- m4/ifdef/ifdef.m4 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 m4/ifdef/ifdef.m4 (limited to 'm4/ifdef') diff --git a/m4/ifdef/ifdef.m4 b/m4/ifdef/ifdef.m4 new file mode 100644 index 0000000..3bc397e --- /dev/null +++ b/m4/ifdef/ifdef.m4 @@ -0,0 +1,19 @@ +m4_dnl Execute this file with ‘m4 -P ifdef.m4 -’ +m4_changequote([,])m4_dnl +m4_dnl +This file has an implementation of ‘__ifdef’ and ‘__endif’ macros. The two +macros act like the ‘#ifdef’ and ‘#endif’ macros from cpp(1). The usage looks +as follows: + +__ifdef(`foo') +This is some text +and some more text +__ifdef(`bar') +This is also some +text on two lines +__endif + +TODO: Add __elifdef()? + +m4_define([__endif], [m4_divert(0)m4_dnl])m4_dnl +m4_define([__ifdef], [m4_ifdef([$1], [__endif], [m4_divert(-1)])])m4_dnl -- cgit v1.2.3