HP C A.06.05 Reference Manual

Data Types and Declarations
Function Definitions
Chapter 3 73
inline
HP C supports inlining frequently used functions. These functions can be inlined by
specifying them as inline either in the function declarator or in the function definition.
NOTE inline is available only with -AC99. For all other options, you must use
__inline.
The optimizer uses its own heuristics to inline a function, if necessary.
Examples
The following examples detail the usage of inline.
Example 3-10 Using inline in Function Declaration
inline void foo(int); //Function declaration with inline specifier
main()
{
foo(5);
}
void foo(int x)
{
. . .
}
Example 3-11 Using inline in Function Definition
main()
{
foo(5);
}
inline foo(int x0) // Function definition with inline specifier
{
. . .
}