Perhaps I should provide some background here.
Macros can be defined with the preprocessor directive #define. The preprocessor does text substitution (search-and-replace) in the initial stage of compilation. So with a source file like
the compiler (after the preprocessor is finished) sees
#define NUMBER 3
int x = NUMBER;
Macros can be undefined with #undef.
Inclosing code in a #if directive causes the code to be removed entirely if the expression is false, or left in place if the expression is true. For
#undef NUMBER /* nothing here */
the complier would see nothing; whereas with #if 1 or some other true expression the compiler would see the printf() statement.
Macros can be tested for defined-ness with #if defined(MACRO) or #ifdef MACRO, which are functionally equivalent.
The inverse, of course, is #if !defined(MACRO), which is the same as #ifndef MACRO.
You can also use #elif and #else; and an if-elif-else chain must end with a #endif. There's no #endif after each #if, #elif, and #else -- just one at the end.
As you can see, preprocessor directives can be nested.
#if VERSION > 2
#error Version too old
Anyway, there's a quick introduction to preprocessor directives. There are lots of others, like #error (which generates a compiler error), #line, which changes the line number, etc. Check some documentation for details. [/edit]
They are called inclusion guards. They're used to prevent a header file from being included multiple times. The first time a header file is included, the macro is not defined, so the header file defines the macro and then the rest of the header file follows. The following times the header is included, the macro is defined, so #if !defined(MACRO) is false, and the header is equivalent to a blank file.
#if !defined(AFX_LIVEVIDEO_H__70943714_3422_4F6A_B79A_ DD84D6EECF17__INCLUDED_)
#define AFX_LIVEVIDEO_H__70943714_3422_4F6A_B79A_DD84D6EEC F17__INCLUDED_
Inclusion guards can prevent many types of errors and are essential for projects with more than a few header files.
The common idiom (which is exactly the same thing) is
/* ... */