Re: IF / ELSE / ENDIF macros for M4
"Mr. Clif" <[email protected]> Tue, 11 May 2021 08:36:17 -0700
| Newsgroups | gmane.comp.gnu.m4.general |
|---|---|
| Message-ID | <[email protected]> |
Hello again, what do you all think about including something like these with the other examples in the upcoming release? Another person wanting this a while back: https://stackoverflow.com/questions/19059432/triple-conditional-check-with-ifdef-in-m4 Any thoughts? :-) Clif On 4/7/21 9:58 AM, Mr. Clif wrote: > Greetings, > > I heard a long time ago that CPP was derived from M4, and read that a > few folks including myself have looked for IF / ENDIF type macros to > use on other projects. CPP is not ideal in that it wants to take extra > steps like tokenizing the source. > > Here is a post from someone else looking: > > https://stackoverflow.com/questions/50549946/conditional-compilation-interpretation-using-m4/66978338#66978338 > > So not finding anything like this, I wrote some that seem to work > pretty well. Here they are: > > http://www.eugeneweb.com/wiki/Sites/M4Macros > > I defined the names without the #'s eg. IF, ELSE, ENDIF, etc... Also > M4 requires parentheses to hold the arguments where CPP does not (at > least for most of these). I also added a selective invoke, to protect > macros with side effects from invocation in an unselected block. > > I was wondering if they pass muster, if the devs might consider > including them or something similar in M4's list of examples. > <https://stackoverflow.com/posts/66978338/timeline> > > Best, > Clif