Controlling the Preprocessor
2-23
C Compiler Description
2.5 Controlling the Preprocessor
During compilation, your code is run through the preprocessor, which is part
of the parser. The shell program allows you to control the preprocessor with
macros and various other preprocessor directives.
This section describes specific features that control the TMS320C2x/C2xx/
C5x preprocessor. Refer to Section A12 of K&R for a general description of
C preprocessing. The TMS320C2x/C2xx/C5x C compiler includes standard
C preprocessing functions, which are built into the first pass of the compiler.
The preprocessor handles the following:
-
Macro definitions and expansions
-
#include files
-
Conditional compilation
-
Various other preprocessor directives (specified in the source file as lines
beginning with the # character)
The preprocessor produces self-explanatory error messages. The line
number and the filename where the error occurred are printed along with a
diagnostic message.
2.5.1 Predefined Macro Names
The compiler maintains and recognizes the predefined macro names listed in
Table 2
Table 2
−
2. Predefined Macro Names
Macro Name
Description
__LINE__
†
Expands to the current line number
__FILE__
†
Expands to the current source filename
__DATE__
†
Expands to the compilation date in the form
mm dd yyyy
__TIME__
†
Expands to the compilation time in the form
hh:mm:ss
_dsp
Expands to 1 (identifies the TMS320C2x/C2xx/C5x compiler)
_TMS320C25
Expands to 1 under the
−
v25 option
_TMS320C2XX
Expands to 1 under the
−
v2xx option
_TMS320C50
Expands to 1 under the
−
v50 option
_INLINE
Expands to 1 under the
−
x or
−
x2 option; undefined otherwise
†
Specified by the ANSI standard
Summary of Contents for TMS320C2x
Page 8: ...viii...
Page 69: ...2 47 C Compiler Description...
Page 159: ...6 36...
Page 226: ...8 6...