Preprocessor Macros

From LSDevLinux
Jump to: navigation, search

This page lists the preprocessor macros for C++ code resp. defines for C# code that are used in FieldWorks code and that are relevant for cross-platform development.

C++ code

_MSC_VER predefined MSVC macro, thus defined on Windows only. Contains version of MSVC compiler.
__GNUC__ predefined GCC macro that contains major version of GCC compiler
_WIN32 predefined MSVC macro. Defined for applications for Win32 and Win64. Always defined on Windows.
WIN32 Defined in MS header files on Windows; not defined on Linux.

C# code

WIN32 defined on Windows, either in .csproj file or by NAnt build process (gets added in Bld/VSConvert-csproj.xsl; platform property set in Bld/SetupInclude.xml)
UNIX defined on Linux, similar to WIN32