### Rules for Matching the Initial Sequence

Once the precompiled initial sequence is created, it can be used in subsequent compiles. Other compilation units can use the precompiled initial sequence under the following conditions:

- The compilation unit has a matching initial sequence of include directives. The compilation unit can have a longer initial sequence, as long as the first part of the sequence matches. Any include directives beyond the initial matching portion are compiled normally.
- The files that make up the precompiled header object have not changed. The compiler checks the modification date on each file.
- Any macros that were expanded or tested while generating the precompiled header object are defined with the same replacement tokens. The compiler checks macro names that are:
  - Defined before the start of the initial sequence, using #define or the /D option
  - Undefined before the start of the initial sequence, using #undef or the /U option
  - Predefined by the compiler

  If the macro was not expanded or tested during the precompile, the status of the macro does not matter, and does not have to match.

- No additional macros have been defined.
- The same compiler options are in effect.

Example
Given two compilation units, prog1.c and prog2.c:

>     prog1.c 		prog2.c
>     ----------------------- -------------------------
>     #undef X 		#define X 1
>     #include "h1.h" 	#include "h1.h"
>     #include "h2.h" 	#include "h2.h"
>     func1() {} 		func2() {}

>     h1.h
>     ----------------------
>     #if TEST
>     int h1;
>     #endif

>     h2.h
>     ----------------------
>     char h2 = M;

The file prog2.c can use the precompiled header object from prog1.c when:

> - TEST has the same definition in both prog1.c and prog2.c, or is not defined in both.
> - M has the same definition in both prog1.c and prog2.c, or is not defined in both.
> - No additional macros have been defined in prog2.c (whether they are used or not).

The different definitions of X in prog1.c and prog2.c do not matter, since X is never tested or expanded.

Precompiled Headers

Example of an Initial Sequence