GNU Autoconf, Automake, and Libtool
by Gary V. Vaughan, Ben Elliston, Tom Tromey, Ian Lance Taylor
22.3.5. Macro Interface
When designing your macro, it is worth spending some time deciding on what your macro's interface (the macro's name and argument list) will be. Often, you can extract general-purpose functionality into a generic macro and write a second macro that is a client of the generic one. Like planning the prototype for a C function, this is usually a straightforward process of deciding what arguments the macro requires to perform its function. You should, however, consider a couple of other things as well.
M4 macros refer to their arguments by number with a syntax such as $1. It is typically more difficult to read an M4 macro definition and understand what each argument's designation is than in a C function body, where the formal ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access