Predefines

Every compiler has some predefined macros. Many of these macros must be defined before real source files can be processed with CScan. The following model and file structure is suggested for CScan projects:
  1. Source stub - #includes the project settings, then the source file.
  2. Project settings - specifies the search path and #defines as desired, then #includes the compiler definitions.
  3. Compiler predefines - the first level #defines version specific settings, then #includes the general compiler definitions.
  4. Compiler general - contains the version independent compiler settings.
  5. Windows defaults - contains the definitely required settings to process the Windows header files.

  6. This file can be #included at the end of an project file for Windows projects.
  7. User defaults - can contain pathes and other user specific preferences.

  8. Only this file should require user specific customization.

Context Abbreviations

ANSI - defined for ANSI C/C++.
BCB - Borland C++ Builder. (also specifies most TC defines)
GCC - GNU gcc. (only classification of symbols common with other compilers)
MSC - Microsoft C/C++. (also Visual C++, MSVC?)
TC - Borland Turbo C.
W32 - required to compile the 32 bit Windows headers, as supplied by Microsoft.

prj - project specific settings. (defaults should not override user specified settings)

Defines

For Windows (32) the following #defines have been found and (partially) classified.
Some symbols specify compiler options which can (and should) be ignored by a general parser. This can be accomplished with empty macro bodies.
Some symbols of the same meaning come in various forms. Only one of such symbols should be specified explicitly, all others should be equated to that primary definition. According to newer C specs the names with 2 leading underscores are the primary symbols. All variations should be defined, to definitely prevent unrecognized identifiers.

The value (parser) applies to extensions which should be ignored if not handled by the parser. The primary symbol is defined as empty when the parser doesn't handle the symbol. All other symbols are equated to the primary symbol.

Symbols in alphabetic order, ignoring underscores and case:
 
Name Value Context Notes
__BCOPT__ 1 BCB Defined in any compiler that has an optimizer.
__BCPLUSPLUS__ __BORLANDC__ BCB Defined if you've selected C++ compilation.
__BORLANDC__ 0x0540 (BCB4)
0x0560 (BCB6)
BCB Compiler version.
__CDECL__ 1 BCB prj Defined if Calling Convention is set to cdecl.
cdecl
_cdecl
__cdecl
(parser) W32 Calling convention modifier.
_CHAR_UNSIGNED 1 ANSI?
W32
Default char type is unsigned.
__CONSOLE__ (no value) BCB When defined, the macro indicates that the program is a console application.
__cplusplus 1 W32 Defined if in C++ mode; otherwise, undefined.
_CPPUNWIND 1 W32 Enable stack unwinding, Exception handling enabled.
__declspec(modifiers) (parser) W32 MSC extension.
Define as empty to ignore the arguments.
_DLL (MSC) (no value) MSC prj Compiling DLL.
__DLL__ 1 BCB prj Compiling DLL.
_fastcall
__fastcall
(parser) WIN32 Calling convention modifier.
__FLAT__ 1 BCB Flat memory model.
__forceinline __inline W32
IN (parser) W32 Parameter extension.
inline
_inline 
__inline
(parser) W32 Inline modifier.
_M_IX86 300 (80386)
400 (80486)
500 (Pentium)
600 (newer)
W32 Target processor (machine)
_MSC_VER 1000 W32 MSC/VC compiler version.
__MSDOS__ 1 BCB
_MT (no value) W32 Multi threaded.
__MT__ 1 BCB Specifies that the multithread library is to be linked.
NDEBUG 1 W32 Compile debug version.
OUT (parser) W32 Parameter extension.
__PASCAL__ 1 BCB Defined if default Calling Convention is set to Pascal.
__STDC__ 1 ANSI? Defined if compiling ANSI C/C++ only.
__stdcall (parser) MSC Calling convention modifier.
__TCPLUSPLUS__ __BORLANDC__ BCB (TC) Version number.
__TEMPLATES__ __cplusplus BCB Defined as 1 for C++ files (meaning that templates are supported); otherwise, it is undefined.
__TLS__ 1 BCB Thread Local Storage.
__TURBOC 1 BCB (TC)
__TURBOC__ __BORLANDC__ BCB (TC)
__w64 (no value) W32 Found in .NET (VS7) Windows headers.
Mark data types whose size differs between 32 and 64 bit platforms. (diagnostic)
_WCHAR_T _WCHAR_T_DEFINED ANSI?
BCB
Defined only for C++ programs to indicate that wchar_t is an intrinsically defined data type.
_WCHAR_T_DEFINED 1 ANSI W32 Defined when wchar_t is defined by compiler option, or when
typedef unsigned short wchar_t;
is executed in code (MSC).
_WIN32 (no value) W32 Compiling for Windows 32.
__WIN32__ 1 BCB Compiling for Windows 32.
_Windows (no value) BCB Compiling for Windows 32.

MSC extensions

Predefined Macros

See Predefined Macros.

Keywords

This is the list of all MSC C/C++ keywords, including Microsoft extensions to ANSI C/C++ (January 2004).

According to ANSI, identifiers with two leading underscores are reserved for compiler implementations. Therefore Microsoft convention is to precede Microsoft-specific keywords with double underscores.

For backward compatibility, single-underscore versions of all the double-underscored keywords except __except, __finally, __leave, and __try are supported. In addition, __cdecl is available with no leading underscore.

Notes:
1   Extended attributes for the __declspec keyword.
2   Applicable to Managed Extensions for C++ only.
3   Intrinsic function used in event handling.

__abstract 2
__alignof __asm __assume
__based
__box 2
__cdecl __declspec
__delegate 2
__event __except __fastcall
__finally __forceinline
__gc 2
__hook 3
__identifier __if_exists __if_not_exists __inline
__int8 __int16 __int32 __int64
__interface __leave __m64 __m128
__m128d __m128i __multiple_inheritance
__nogc 2
__noop
__pin 2 __property 2
__raise
__sealed 2
__single_inheritance __stdcall __super
__try_cast 2
__try/__except,__try/__finally
__unhook 3
__uuidof
__value 2
__virtual_inheritance __w64 bool
break case catch char
class const const_cast continue
default delete
deprecated 1 dllexport 1 dllimport 1
do double dynamic_cast
else enum explicit extern
false float for friend
goto if inline int
long mutable
naked 1
namespace
new
noinline 1 noreturn 1 nothrow 1 novtable 1
operator private
property 1
protected public register reinterpret_cast
return
selectany 1
short signed
sizeof static static_cast struct
switch template this
thread 1
throw true try typedef
typeid typename union unsigned
using declaration,
using directive
uuid 1
virtual void
volatile
__wchar_t, wchar_t
while