10.4.1. Macro definition

A macro definition must contain:

The syntax of a macro definition is as follows:

DEFINE [return_type] macro_name([parameter_list])
[param_definitions]
{
macro_body
}
.

where:

return_type

Determines the type of the macro return value and is an optional component of the macro definition. The default type is int. For an example using return types see Macro return values.

parameter_list

Specifies a parameter list in the same way as arguments are specified for a C function and is an optional component of the macro definition. If parameter_list is defined then the type must also be specified or else type int is assumed. The following example illustrates the use of a parameter_list:

define int scpy(target, source)
char *target;
char *source;

The declaration defines arguments for the macro scpy(). The type of both the target and the source are declared to be pointers to a char.

Copyright © 2003, 2004 ARM Limited. All rights reserved.ARM DUI 0234B
Non-Confidential