RAD Studio
ContentsIndex
PreviousUpNext
Predefined Macros

The compiler predefines certain global identifiers, known as manifest constants. Most global identifiers begin and end with two underscores (__).

Note: For readability, underscores are often separated by a single blank space. In your source code, you should never insert whitespace between underscores.

Macro 
Value 
Description 
__BCOPT__  
1  
Defined in any compiler that has an optimizer.  
__BCPLUSPLUS__  
  • 0x0570 for BDS 2006
  • 0x0590 for C++Builder 2007
  • 0x0591 for update 1 to C++Builder 2007
  • 0x0592 for RAD Studio 2007
  • 0x0593 for the December update to RAD Studio 2007
 
Defined if you've selected C++ compilation; will increase in later releases.  
__BORLANDC__  
  • 0x0570 for BDS 2006
  • 0x0590 for C++Builder 2007
  • 0x0591 for update 1 to C++Builder 2007
  • 0x0592 for RAD Studio 2007
  • 0x0593 for the December update to RAD Studio 2007
 
Version number.  
__CDECL__  
1  
Defined if Calling Convention is set to cdecl; otherwise undefined.  
_CHAR_UNSIGNED  
1  
Defined by default indicating that the default char is unsigned char. Use the -K compiler option to undefine this macro.  
__CODEGUARD__  
 
Defined whenever one of the CodeGuard compiler options is used; otherwise it is undefined.  
__CONSOLE__  
1  
When defined, the macro indicates that the program is a console application.  
_CPPUNWIND  
1  
Enable stack unwinding. This is true by default; use -xd-!ALink(OSCGExceptions1) to disable.  
__cplusplus  
1  
Defined if in C++ mode; otherwise, undefined.  
__DATE__  
String literal  
Date when processing began on the current file.  
__DLL__  
1  
Defined whenever the -WD compiler option is used; otherwise it is undefined.  
__FILE__  
String literal  
Name of the current file being processed.  
__FLAT__  
1  
Defined when compiling in 32-bit flat memory model.  
__FUNC__  
String literal  
Name of the current function being processed. More details.  
__LINE__  
Decimal constant  
Number of the current source file line being processed.  
_M_IX86  
0x12c  
Always defined. The default value is 300. You can change the value to 400 or 500 by using the /4 or /5 compiler options.  
__MT__  
1  
Defined only if the -tWM option is used. It specifies that the multithread library is to be linked.  
__PASCAL__  
1  
Defined if Calling Convention is set to Pascal; otherwise undefined.  
__STDC__  
1  
Defined if you compile with the -A compiler option; otherwise, it is undefined.  
__TCPLUSPLUS__  
0x0570  
Version number.  
__TEMPLATES__  
1  
Defined as 1 for C++ files (meaning that templates are supported); otherwise, it is undefined.  
__TIME__  
String literal  
Time when processing began on the current file.  
__TLS__  
1  
Thread Local Storage. Always true.  
__TURBOC__  
  • 0x0570 for BDS 2006
  • 0x0590 for C++Builder 2007
  • 0x0591 for update 1 to C++Builder 2007
  • 0x0592 for RAD Studio 2007
  • 0x0593 for the December update to RAD Studio 2007
 
Will increase in later releases.  
_WCHAR_T  
 
Defined only for C++ programs to indicate that wchar_t is an intrinsically defined data type.  
_WCHAR_T_DEFINED  
 
Defined only for C++ programs to indicate that wchar_t is an intrinsically defined data type.  
_Windows  
 
Defined when compiling on the Windows platform.  
__WIN32__  
1  
Defined for console and GUI applications on the Windows platform.  
__linux__  
 
Defined when compiling on the Linux platform.  

Note: __DATE__
, __FILE__ , __FUNC__, __LINE__, __STDC__, and __TIME__ cannot be redefined or undefined.

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!