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 ...

Get GNU Autoconf, Automake, and Libtool now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.