1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <meta http-equiv="Content-Style-Type" content="text/css" /> 6 <link rel="stylesheet" href="../css/manpage.css" type="text/css" /> 7 <link rel="stylesheet" href="../css/timetable.css" type="text/css" /> 8 <title>#ifdef, #ifndef, #if, #else, #elif, #endif</title> 9 </head> 10 <body> 11 <h1>#ifdef, #ifndef, #if, #else, #elif, #endif</h1> 12 13 <h2>Overview</h2> 14 <div class="section"> 15 <p> 16 Used for conditional compiling using macros.<br> <CODE>#if</CODE> and <CODE>#elif</CODE> also support the following evaluation formulae. 17 </p> 18 <ul> 19 <li>Values (values that can be expressed as signed 32-bit integers. Behavior is undefined for other values).</li> 20 <li>The negative sign for a given value (addition and subtraction expressions not supported).</li> 21 <li>defined(macro name)</li> 22 <li>!defined(macro name)</li> 23 <li>Equality operators (==, !=)</li> 24 <li>Relational operators (<, <=, >, >=)</li> 25 <li>Bitwise AND (&&), bitwise OR (||)</li> 26 <li>Combinations of the above.</li> 27 </ul> 28 <p class="warning"> 29 Errors are generated when undefined macros are used in evaluation formulae.<br> 30 </p> 31 </div> 32 33 <h2>Code Example</h2> 34 <div class="section"> 35<pre class="definition"> 36#define USE_FUNCTION_A 37#ifdef USE_FUNCTION_A 38 FunctionA: 39 ... 40#endif 41 42 43#if (defined(AAA) && (BBB == 1)) 44 ... 45#endif 46</pre> 47 </div> 48 49 50 <h2>Revision History</h2> 51 <div class="section"> 52 <dl class="history"> 53 <dt>2011/12/20</dt> 54 <dd>Initial version.<br /> 55 </dd> 56 </dl> 57 </div> 58 59 <hr><p>CONFIDENTIAL</p></body> 60</html>