Using The -D And -U Command-line Options

From RAD Studio
Jump to: navigation, search

Go Up to Defining And Undefining Macros Index

Identifiers can be defined and undefined using the command-line compiler options -D and -U. The following syntax can be used:




The -Dname option defines the identifier name to the null string. -Dname=string defines name to string. In this assignment, string cannot contain spaces or tabs.

The -Uname command-line option undefines the previous definition of the identifier name.

You can also define multiple identifiers with a single #define option. Use a semicolon (;) to separate definitions of identifiers.

For example, the command line

BCC32.EXE -Ddebug=1; paradox=0; X -Umysym myprog.c

is equivalent to placing

#define debug 1
#define paradox 0
#define X
#undef mysym

in the myprog.c file.

See Also