When creating a set of #define directives in an #include file, enclose the entire set inside an #ifndef block and #define a special identifier for that block. For example, here are some lines from the VDBASE.H file that includes #define directives for many of the enumerated values used in dBASE Plus:

#ifndef VDBASE_H

#define VDBASE_H

// Constants for MSGBOX( )

#define OK_BUTTON 0

#define OK_CANCEL_BUTTONS 1

#define ABORT_RETRY_IGNORE_BUTTONS 2

#define YES_NO_CANCEL_BUTTONS 3

#define YES_NO_BUTTONS 4

#define RETRY_CANCEL_BUTTONS 5

#endif

If you #include the same file twice in the same program file (which often happens because some #include files #include other files), the #ifndef directive will make sure that #define directives are processed only once. Attempting to #define the same identifier twice causes an error.