From mboxrd@z Thu Jan 1 00:00:00 1970 Subject: Re: [edk2-devel] [PATCH] BaseTools: Fix an incremental build issue caused by macro in #include To: Bob Feng ,devel@edk2.groups.io From: "Lin, Derek (HPS SW)" X-Originating-Location: Singapore, SG (15.211.153.75) X-Originating-Platform: Windows Chrome 77 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Wed, 16 Oct 2019 19:02:11 -0700 References: <08650203BA1BD64D8AD9B6D5D74A85D16154B6BD@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <08650203BA1BD64D8AD9B6D5D74A85D16154B6BD@SHSMSX104.ccr.corp.intel.com> Message-ID: <8529.1571277731931002832@groups.io> Content-Type: multipart/alternative; boundary="DNYg7t8vECyu3Oibvrjs" --DNYg7t8vECyu3Oibvrjs Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Phillippe, Yeah, I forgot to fill my example. Thanks for the catch. It is exactly as Bob mentioned, #include MACRO(xxx.h). There are silicon code use macro to separate definitions, and use the appr= oach to reuse code. Like: #define PATH(x) // in platform 1 #define PATH(x) // in platform 2 #include PATH(abc.h)=C2=A0 =C2=A0// in common code --DNYg7t8vECyu3Oibvrjs Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Phillippe,

Yeah, I forgot to fill my example. Thanks for the = catch.

It is exactly as Bob mentioned, #include MACRO(xxx.h).
There are silicon code use macro to separate definitions, and use = the approach to reuse code. Like:
#define PATH(x) <silicon1/x.h>= // in platform 1
#define PATH(x) <silicon2/x.h> // in platform = 2
#include PATH(abc.h)   // in common code --DNYg7t8vECyu3Oibvrjs--