Symbian3/SDK/Source/GUID-10F1D390-2CB6-584B-B760-E6A6E1D8FDDA.dita
changeset 13 48780e181b38
parent 12 80ef3a206772
child 14 578be2adaf3e
equal deleted inserted replaced
12:80ef3a206772 13:48780e181b38
     1 <?xml version="1.0" encoding="utf-8"?>
       
     2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
       
     3 <!-- This component and the accompanying materials are made available under the terms of the License 
       
     4 "Eclipse Public License v1.0" which accompanies this distribution, 
       
     5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
       
     6 <!-- Initial Contributors:
       
     7     Nokia Corporation - initial contribution.
       
     8 Contributors: 
       
     9 -->
       
    10 <!DOCTYPE concept
       
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
       
    12 <concept xml:lang="en" id="GUID-10F1D390-2CB6-584B-B760-E6A6E1D8FDDA"><title>C++ pre-processor statements</title><prolog><metadata><keywords/></metadata></prolog><conbody><p>The following pre-processor statements are supported by the resource compiler:</p> <ul><li id="GUID-B6A111FB-FFA2-531C-91EE-35DB9AF19A9A"><p><codeph>#define</codeph> </p> </li> <li id="GUID-C0EF333E-FE70-5EF3-BE14-04A89AF99C85"><p><codeph>#undef</codeph> </p> </li> <li id="GUID-7BAC9B37-F0A3-5578-A9BC-6DEB4A2D2E94"><p><codeph>#line</codeph> </p> </li> <li id="GUID-99F8E077-BB0B-56BD-AFFA-337E2B5956FF"><p><codeph>#include</codeph> </p> </li> <li id="GUID-A47F1114-2DAB-5D15-AE12-4505D527D8E3"><p><codeph>#ifdef</codeph> </p> </li> <li id="GUID-FDD096E0-E286-5CF0-89A3-F9F82E2FE506"><p><codeph>#ifndef</codeph> </p> </li> <li id="GUID-D8A7A176-582C-5A50-B7D7-FE6CD744F709"><p><codeph>#if</codeph> </p> </li> <li id="GUID-749EED33-0711-5E12-B3B3-C4F48A249775"><p><codeph>#else</codeph> </p> </li> <li id="GUID-A03EA147-F9F4-575A-BE46-79BDA3C4BB4A"><p><codeph>#endif</codeph> </p> </li> </ul> <p>The following sections give more detail on the use of the <codeph>#ifdef</codeph> and <codeph>#include</codeph> statements.</p> <section id="GUID-934725A2-90C8-522F-9E25-5E2993049976"><title>Conditional compilation in resource files</title> <p>The resource compiler supports conditional compilation such as</p> <codeblock id="GUID-24DB03FA-A503-5E14-8A78-3A011F4CE634" xml:space="preserve">#ifdef SOMETHING 
       
    13 // do something 
       
    14 #else 
       
    15 // do something else 
       
    16 #endif</codeblock> <p>or</p> <codeblock id="GUID-8CE01535-672E-5FBE-BBD9-2DB6FCE44959" xml:space="preserve">#ifndef WHATEVER 
       
    17 // do something 
       
    18 #endif</codeblock> </section> <section><title>Include files within a source file</title> <p>You can include files within the source file by using a <codeph>#include</codeph> directive, for example:</p> <codeblock id="GUID-E96237E1-93C5-51DF-92E1-E7CC86E9DA42" xml:space="preserve">#include &lt;eikdef.rh&gt;</codeblock> <p>or </p> <codeblock id="GUID-C2587C86-8839-593E-B33A-AC8368DD6B61" xml:space="preserve">#include "eikdef.hrh"</codeblock> <p>The searching algorithm used by the resource compiler depends on whether the item to be included is enclosed in double-quotes or angled brackets.</p> <p>If the filename is enclosed in double-quotes, the resource compiler searches for that file through the following directories in the following order:</p> <ul><li id="GUID-FCCC6197-6ECA-5CAD-9620-071D9A2438EE"><p>the <i>current</i> directory</p> </li> <li id="GUID-06833D1D-FB68-56FB-85FA-CCD1FA149C9C"><p>the relative directory <filepath>..\inc</filepath> </p> </li> <li id="GUID-E6A7515D-B1DE-5279-808A-AD1D9F8D3459"><p>the absolute directory <varname>epocroot</varname> <filepath>\epoc32\include</filepath> </p> </li> </ul> <p>If the filename is enclosed in angled brackets, the resource compiler searches for that file through the following directories in the following order:</p> <ul><li id="GUID-A9F5D3C9-C143-5A94-B31D-58AB83485F72"><p>the relative directory <filepath>..\inc</filepath> </p> </li> <li id="GUID-D33154C8-E215-588C-B186-C3FF2C00ABE9"><p>the absolute directory <varname>epocroot</varname> <filepath>\epoc32\include</filepath> </p> </li> </ul> </section> </conbody></concept>