summaryrefslogtreecommitdiff
path: root/BaseTools/Source/Python/AutoGen/GenC.py
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2011-11-25 06:21:03 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2011-11-25 06:21:03 +0000
commit2bcc713e74b944bb5aefb433ef33fb4002a62d76 (patch)
tree7aa002279415c1fafbedbf287d256177746e0a4a /BaseTools/Source/Python/AutoGen/GenC.py
parentc32dcd284c19bbb0b1db3606a243d9d69d37d6ab (diff)
downloadedk2-platforms-2bcc713e74b944bb5aefb433ef33fb4002a62d76.tar.xz
Sync BaseTool trunk (version r2423) into EDKII BaseTools. The change mainly includes:
1. Fix !include issues 2. Fix Trim to skip the postfix 'U' for hexadecimal and decimal numbers 3. Fix building error C2733 when building C++ code. 4. Add GCC46 tool chain definition 5. Add new RVCT and RVCTLINUX tool chains Signed-off-by: lgao4 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12782 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/Python/AutoGen/GenC.py')
-rw-r--r--BaseTools/Source/Python/AutoGen/GenC.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/BaseTools/Source/Python/AutoGen/GenC.py b/BaseTools/Source/Python/AutoGen/GenC.py
index 561114d141..5638bfd043 100644
--- a/BaseTools/Source/Python/AutoGen/GenC.py
+++ b/BaseTools/Source/Python/AutoGen/GenC.py
@@ -310,11 +310,14 @@ gAutoGenHPrologueString = TemplateString("""
#ifndef _${File}_${Guid}
#define _${File}_${Guid}
+""")
+
+gAutoGenHCppPrologueString = """
#ifdef __cplusplus
extern "C" {
#endif
-""")
+"""
gAutoGenHEpilogueString = """
@@ -1970,6 +1973,7 @@ def CreateHeaderCode(Info, AutoGenC, AutoGenH):
AutoGenH.Append(gAutoGenHeaderString.Replace({'FileName':'AutoGen.h'}))
# header file Prologue
AutoGenH.Append(gAutoGenHPrologueString.Replace({'File':'AUTOGENH','Guid':Info.Guid.replace('-','_')}))
+ AutoGenH.Append(gAutoGenHCppPrologueString)
if Info.AutoGenVersion >= 0x00010005:
# header files includes
AutoGenH.Append("#include <%s>\n" % gBasicHeaderFile)