-D: Macro Definition

Group

LANGUAGE

Scope

Compilation Unit

Syntax
  -D<identifier>[=<value>]
  
  
Arguments

<identifier>: identifier to be defined

<value>: value for <identifier>, anything except "-" and blank

Default

None

Defines

None

Pragmas

None

Description

The Compiler allows the definition of a macro on the command line. The effect is the same as having a # define directive at the very beginning of the source file.

Listing: DEBUG Macro Definition


-DDEBUG=0
This is the same as writing:

#define DEBUG 0

in the source file.

To include strings with blanks in your macro definition, either use an escape sequence or use double quotes.

  -dPath="Path\40with\40spaces"
  
  
  -d"Path=""Path with spaces"""
  
  
Note: Blanks are not allowed after the -D option; the first blank terminates this option. Also, macro parameters are not supported.