C5_#undef

#undef
 Remove a #define macro definition
------------------------------------------------------------------------------
 Syntax

     #undef <identifier>

 Arguments

     <identifier> is the name of the manifest constant or pseudofunction
     to remove.

 Description

     #undef removes an identifier defined with the #define directive. After
     an #undef, the specified identifier becomes undefined.  Use #undef to
     remove an identifier before you redefine it with #define, preventing the
     compiler warning that occurs when an existing identifier is redefined.
     Also, use #undef to make conditional compilation specific to certain
     sections of a program.

 Examples

     .  To define and then undefine a manifest constant and a
        pseudofunction:

        #define K_ESC  27
        #define MAX(x, y)   IF(x > y, x, y)
        .
        . <statements>
        .
        #undef K_ESC
        #undef MAX

     .  To use #undef to undefine an identifier before redefining it:

        #define DEBUG
        .
        . <statements>
        .
        #undef DEBUG
        #define DEBUG   .T.

     .  To undefine an identifier if it exists, and otherwise define
        it for later portions of the program file:

        #ifdef TEST
           #undef TEST
        #else
           #define TEST
        #endif

See Also: #define #ifdef #ifndef



2 responses to “C5_#undef

  1. Pingback: C5_#define | Viva Clipper !

  2. Pingback: C5 Directives | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.