Inlining C Code

Sather - A Language Tutorial
Prev | Chapter 14. Interfacing with ANSI C | Next

# 14.5. Inlining C Code

Sometimes it isn't possible to decide at the time the external C class is written whether a routine will be implemented in the C code with a macro. This presents a portability problem, because the writer of the external class can't know ahead of time whether the routine will be obtained by linking or by a header file. Such petulant cases can be dealt with by the call '`SYS::inlined_C`'. The argument must be a string literal, and is placed directly into the generated code, except that identifiers following '`#`' that correspond to locals and arguments are translated into the appropriate C names.

Prev | Home | Next
Parameter Passing | Up | Statement and Expression Catalogue