Name

$NoDefine Compiler Directive

Syntax

{$NoDefine Identifier}

Scope

Local

Description

The $NoDefine compiler directive prevents C++ Builder from writing the definition of Identifier to the unit’s .hpp file. Unlike $ExternalSym, the compiler assumes that you will provide an alternate definition of Identifier by using the $HppEmit directive. When you do so, you must be sure to define the symbol in the unit’s namespace.

Example

unit Complex;
interface
type
  TComplex = record
    Real, Imag:  Double;
  end;
  {NoDefine   TComplex}
  (*$HppEmit  'namespace Complex  {*)
  (*$HppEmit  '  class TComplex  {' *)
  (*$HppEmit  '  public: ' *)
(*$HppEmit  '      TComplex() : m_real(0), m_imag(0) {} ' *)
(*$HppEmit  '    private: ' *)
(*$HppEmit  '      double m_real, m_imag; ' *)
(*$HppEmit  '    }; ' *)
(*$HppEmit  '};' *)

See Also

$ExternalSym Compiler Directive, $HppEmit Compiler Directive, $NoInclude Compiler Directive

Get Delphi in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.