94
Section 2: Compiler
TI
-
89 / TI
-
92 Plus Sierra C Assembler Reference Manual
Not for Distribution
Beta Version February 2, 2001
2.16.1.
Source File Inclusion
The #include directive causes the contents of the named file to be treated as if it
had appeared in place of the directive itself. The included file can contain
anything that is permitted in the including file, including other #include directives.
The argument to the #include directive, used to specify the file for inclusion, can
take one of three forms.
A preprocessing directive of the following form specifies that the filename
(optionally preceded by directory information) is to be searched for in a series of
standard directories:
#include <filename>
The standard directories can be defined both on the compiler command line
using the
-I
flag and by setting the INCLUDE68 environment variable. The
filename is searched for until it is located, first in the directories named on the
command line (in the order listed) and then in the directory(ies) defined by
INCLUDE68. If INCLUDE68 is not set, the include subdirectory of the directory
specified by the SIERRA environment variable is searched.
A preprocessing directive of the following form specifies that the filename
(optionally preceded by directory information) is to be searched for in association
with the original source file:
#include "filename"
Alternatively, the filename is searched for in association with the including file
when the
-R
compiler command line flag is specified. If the filename is not
located in association with the appropriate file, the #include directive is
processed as if the filename had been enclosed in angle brackets as in the
previously described form.
A preprocessing directive of the following form is also permitted:
#include preprocessor_tokens
Macro names among the preprocessor tokens after the #include directive are
processed the same as any other macro names in the file. The directive that
results after macro substitution must match one of the two previous forms and is
processed accordingly.
2.16.2. Conditional
Compilation
The
#if directives (i.e., #if, #else, #elif, #ifdef, #ifndef, and #endif) allow
selected lines of text in the file to be conditionally included or excluded from
further processing.