13.07.2015 Views

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

C++ LanguageMacro__VIRTUAL_FUNCTION_INDEX_TYPE__VIRTUAL_FUNCTION_TYPE__WCHAR_MIN / __WCHAR_MAX_WCHAR_TDescriptionDefines the type of the virtual function indexfield of the virtual function table. This macrois used when building the C++ library.Defines the type of the virtual function field ofthe virtual function table. This macro is usedwhen building the C++ library.Used in stdint.h to define theminimum/maximum value of a wchar_t typerespectively.Defined when wchar_t is a keyword.2.10. Precompiled HeadersIt is often desirable to avoid recompiling a set of header files, especially when they introduce many linesof code and the primary source files that #include them are relatively small.The C++ compiler providesa mechanism <strong>for</strong>, in effect, taking a snapshot of the state of the compilation at a particular point and writingit to a disk file be<strong>for</strong>e completing the compilation; then, when recompiling the same source file or compilinganother file with the same set of header files, it can recognize the "snapshot point", verify that thecorresponding precompiled header (PCH) file is reusable, and read it back in. Under the rightcircumstances, this can produce a dramatic improvement in compilation time; the trade-off is that PCHfiles can take a lot of disk space.2.10.1. Automatic Precompiled Header ProcessingWhen --pch appears on the command line, automatic precompiled header processing is enabled. Thismeans the C++ compiler will automatically look <strong>for</strong> a qualifying precompiled header file to read in and/orwill create one <strong>for</strong> use on a subsequent compilation.The PCH file will contain a snapshot of all the code preceding the "header stop" point. The header stoppoint is typically the first token in the primary source file that does not belong to a preprocessing directive,but it can also be specified directly by #pragma hdrstop (see below) if that comes first. For example:#include "xxx.h"#include "yyy.h"int i;The header stop point is int (the first non-preprocessor token) and the PCH file will contain a snapshotreflecting the inclusion of xxx.h and yyy.h. If the first non-preprocessor token or the #pragma hdrstopappears within a #if block, the header stop point is the outermost enclosing #if. To illustrate, heres amore complicated example:#include "xxx.h"#ifndef YYY_H#define YYY_H 1#include "yyy.h"#endif77

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!