fix GCC53 compatibility

Signed-off-by: Sergey Isakov <isakov-sl@bk.ru>
This commit is contained in:
Sergey Isakov 2020-02-25 20:42:06 +03:00
parent a4952d32de
commit 282bc531d7
3 changed files with 84 additions and 17 deletions

View File

@ -92,12 +92,10 @@
A5456D8323FC5B40000BF18C /* list.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5456D7C23FC5B40000BF18C /* list.cpp */; };
A5456D9023FC5B72000BF18C /* globals_dtor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5456D8423FC5B6D000BF18C /* globals_dtor.cpp */; };
A5456D9123FC5B72000BF18C /* globals_ctor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5456D8523FC5B6E000BF18C /* globals_ctor.cpp */; };
A5456D9223FC5B72000BF18C /* global1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5456D8923FC5B6F000BF18C /* global1.cpp */; };
A5456D9323FC5B72000BF18C /* memory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5456D8A23FC5B70000BF18C /* memory.cpp */; };
A5456D9423FC5B72000BF18C /* XStringW.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5456D8B23FC5B70000BF18C /* XStringW.cpp */; };
A5456D9523FC5B72000BF18C /* global2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5456D8D23FC5B71000BF18C /* global2.cpp */; };
A5456D9623FC5B72000BF18C /* operatorNewDelete.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5456D8E23FC5B71000BF18C /* operatorNewDelete.cpp */; };
A5716F83235968BE000CEC60 /* Nasm.inc in Sources */ = {isa = PBXBuildFile; fileRef = A5716F82235968BE000CEC60 /* Nasm.inc */; };
A571C28D240574DA00B6A2C5 /* XImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A571C28B240574D900B6A2C5 /* XImage.cpp */; };
A59CB66921BC14AB0054A7CF /* SmbiosGen.c in Sources */ = {isa = PBXBuildFile; fileRef = A59CB66521BC14AA0054A7CF /* SmbiosGen.c */; };
A5AA044C237F13C0009CD413 /* Nasm.inc in Sources */ = {isa = PBXBuildFile; fileRef = A5AAFD7A237F13BC009CD413 /* Nasm.inc */; };
A5AA044D237F13C0009CD413 /* Nasm.inc in Sources */ = {isa = PBXBuildFile; fileRef = A5AAFF1F237F13BD009CD413 /* Nasm.inc */; };
@ -2389,12 +2387,8 @@
A5456D8523FC5B6E000BF18C /* globals_ctor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = globals_ctor.cpp; sourceTree = "<group>"; };
A5456D8623FC5B6E000BF18C /* memory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = memory.h; sourceTree = "<group>"; };
A5456D8723FC5B6E000BF18C /* globals_dtor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = globals_dtor.h; sourceTree = "<group>"; };
A5456D8823FC5B6F000BF18C /* XStringW.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XStringW.h; sourceTree = "<group>"; };
A5456D8923FC5B6F000BF18C /* global1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = global1.cpp; sourceTree = "<group>"; };
A5456D8A23FC5B70000BF18C /* memory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = memory.cpp; sourceTree = "<group>"; };
A5456D8B23FC5B70000BF18C /* XStringW.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XStringW.cpp; sourceTree = "<group>"; };
A5456D8C23FC5B70000BF18C /* operatorNewDelete.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = operatorNewDelete.h; sourceTree = "<group>"; };
A5456D8D23FC5B71000BF18C /* global2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = global2.cpp; sourceTree = "<group>"; };
A5456D8E23FC5B71000BF18C /* operatorNewDelete.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = operatorNewDelete.cpp; sourceTree = "<group>"; };
A5456D8F23FC5B72000BF18C /* globals_ctor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = globals_ctor.h; sourceTree = "<group>"; };
A5611B2A21DCB97F008FDB96 /* Riff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Riff.h; sourceTree = "<group>"; };
@ -2464,6 +2458,35 @@
A5717012235A187C000CEC60 /* DataHubStdErrDxe.uni */ = {isa = PBXFileReference; lastKnownFileType = text; path = DataHubStdErrDxe.uni; sourceTree = "<group>"; };
A5717014235A188B000CEC60 /* DriverOverride.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = DriverOverride.c; sourceTree = "<group>"; };
A5717015235A188B000CEC60 /* DriverOverride.inf */ = {isa = PBXFileReference; lastKnownFileType = text; path = DriverOverride.inf; sourceTree = "<group>"; };
A571C26F2405749900B6A2C5 /* XStringWArray.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XStringWArray.h; sourceTree = "<group>"; };
A571C2702405749900B6A2C5 /* XToolsCommon.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XToolsCommon.h; sourceTree = "<group>"; };
A571C2712405749900B6A2C5 /* XStringW.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XStringW.h; sourceTree = "<group>"; };
A571C2722405749900B6A2C5 /* XStringWArray.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = XStringWArray.cpp; sourceTree = "<group>"; };
A571C2732405749900B6A2C5 /* XStringW.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = XStringW.cpp; sourceTree = "<group>"; };
A571C2742405749900B6A2C5 /* utf8Conversion.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = utf8Conversion.cpp; sourceTree = "<group>"; };
A571C2752405749900B6A2C5 /* utf8Conversion.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = utf8Conversion.h; sourceTree = "<group>"; };
A571C2762405749900B6A2C5 /* printf_lite.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = printf_lite.cpp; sourceTree = "<group>"; };
A571C2772405749900B6A2C5 /* XToolsCommon.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = XToolsCommon.cpp; sourceTree = "<group>"; };
A571C2782405749900B6A2C5 /* printf_lite.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = printf_lite.h; sourceTree = "<group>"; };
A571C2792405749900B6A2C5 /* XArray.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XArray.h; sourceTree = "<group>"; };
A571C27A2405749900B6A2C5 /* XObjArray.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XObjArray.h; sourceTree = "<group>"; };
A571C27C240574A100B6A2C5 /* global2.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = global2.h; sourceTree = "<group>"; };
A571C27D240574A100B6A2C5 /* XStringWArray_test.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XStringWArray_test.h; sourceTree = "<group>"; };
A571C27E240574A100B6A2C5 /* XArray_tests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XArray_tests.h; sourceTree = "<group>"; };
A571C27F240574A100B6A2C5 /* XStringWArray_test.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = XStringWArray_test.cpp; sourceTree = "<group>"; };
A571C280240574A100B6A2C5 /* global1.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = global1.cpp; sourceTree = "<group>"; };
A571C281240574A100B6A2C5 /* global1.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = global1.h; sourceTree = "<group>"; };
A571C282240574A100B6A2C5 /* global2.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = global2.cpp; sourceTree = "<group>"; };
A571C283240574A100B6A2C5 /* XStringW_test.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XStringW_test.h; sourceTree = "<group>"; };
A571C284240574A100B6A2C5 /* XObjArray_tests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XObjArray_tests.h; sourceTree = "<group>"; };
A571C285240574A100B6A2C5 /* all_tests.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = all_tests.cpp; sourceTree = "<group>"; };
A571C286240574A100B6A2C5 /* XObjArray_tests.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = XObjArray_tests.cpp; sourceTree = "<group>"; };
A571C287240574A100B6A2C5 /* XArray_tests.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = XArray_tests.cpp; sourceTree = "<group>"; };
A571C288240574A100B6A2C5 /* all_tests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = all_tests.h; sourceTree = "<group>"; };
A571C289240574A100B6A2C5 /* XStringW_test.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = XStringW_test.cpp; sourceTree = "<group>"; };
A571C28A240574BB00B6A2C5 /* remove_ref.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = remove_ref.h; sourceTree = "<group>"; };
A571C28B240574D900B6A2C5 /* XImage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XImage.cpp; sourceTree = "<group>"; };
A571C28C240574D900B6A2C5 /* XImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XImage.h; sourceTree = "<group>"; };
A59CB66521BC14AA0054A7CF /* SmbiosGen.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SmbiosGen.c; sourceTree = "<group>"; };
A59CB66621BC14AA0054A7CF /* SmbiosGen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SmbiosGen.h; sourceTree = "<group>"; };
A59CB66721BC14AA0054A7CF /* SmbiosGen.inf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SmbiosGen.inf; sourceTree = "<group>"; };
@ -6022,12 +6045,14 @@
126151381A15BBAF00903E7B /* rEFIt_UEFI */ = {
isa = PBXGroup;
children = (
A571C26E2405749900B6A2C5 /* cpp_foundation */,
A571C27B240574A100B6A2C5 /* cpp_unit_test */,
A5DEBF3423BF687D00C41734 /* cpp_util */,
126151391A15BBAF00903E7B /* entry_scan */,
126151471A15BBB000903E7B /* include */,
1261514B1A15BBB000903E7B /* libeg */,
126151561A15BBB000903E7B /* Platform */,
126151941A15BBB000903E7B /* refit */,
A5DEBF3423BF687D00C41734 /* cpp_util */,
1261519F1A15BBB000903E7B /* refit.inf */,
126151A01A15BBB000903E7B /* Version.h */,
);
@ -6093,6 +6118,8 @@
A5456CEF23FC5AB4000BF18C /* scroll_images.cpp */,
A5456CF223FC5AB6000BF18C /* text.cpp */,
A5456CF523FC5AB7000BF18C /* VectorGraphics.cpp */,
A571C28B240574D900B6A2C5 /* XImage.cpp */,
A571C28C240574D900B6A2C5 /* XImage.h */,
);
path = libeg;
sourceTree = "<group>";
@ -8147,6 +8174,46 @@
path = FromEDK2;
sourceTree = "<group>";
};
A571C26E2405749900B6A2C5 /* cpp_foundation */ = {
isa = PBXGroup;
children = (
A571C26F2405749900B6A2C5 /* XStringWArray.h */,
A571C2702405749900B6A2C5 /* XToolsCommon.h */,
A571C2712405749900B6A2C5 /* XStringW.h */,
A571C2722405749900B6A2C5 /* XStringWArray.cpp */,
A571C2732405749900B6A2C5 /* XStringW.cpp */,
A571C2742405749900B6A2C5 /* utf8Conversion.cpp */,
A571C2752405749900B6A2C5 /* utf8Conversion.h */,
A571C2762405749900B6A2C5 /* printf_lite.cpp */,
A571C2772405749900B6A2C5 /* XToolsCommon.cpp */,
A571C2782405749900B6A2C5 /* printf_lite.h */,
A571C2792405749900B6A2C5 /* XArray.h */,
A571C27A2405749900B6A2C5 /* XObjArray.h */,
);
path = cpp_foundation;
sourceTree = "<group>";
};
A571C27B240574A100B6A2C5 /* cpp_unit_test */ = {
isa = PBXGroup;
children = (
A571C27C240574A100B6A2C5 /* global2.h */,
A571C27D240574A100B6A2C5 /* XStringWArray_test.h */,
A571C27E240574A100B6A2C5 /* XArray_tests.h */,
A571C27F240574A100B6A2C5 /* XStringWArray_test.cpp */,
A571C280240574A100B6A2C5 /* global1.cpp */,
A571C281240574A100B6A2C5 /* global1.h */,
A571C282240574A100B6A2C5 /* global2.cpp */,
A571C283240574A100B6A2C5 /* XStringW_test.h */,
A571C284240574A100B6A2C5 /* XObjArray_tests.h */,
A571C285240574A100B6A2C5 /* all_tests.cpp */,
A571C286240574A100B6A2C5 /* XObjArray_tests.cpp */,
A571C287240574A100B6A2C5 /* XArray_tests.cpp */,
A571C288240574A100B6A2C5 /* all_tests.h */,
A571C289240574A100B6A2C5 /* XStringW_test.cpp */,
);
path = cpp_unit_test;
sourceTree = "<group>";
};
A59CB66421BC14AA0054A7CF /* OsxSmbiosGenDxe */ = {
isa = PBXGroup;
children = (
@ -15347,8 +15414,6 @@
A5DEBF3423BF687D00C41734 /* cpp_util */ = {
isa = PBXGroup;
children = (
A5456D8923FC5B6F000BF18C /* global1.cpp */,
A5456D8D23FC5B71000BF18C /* global2.cpp */,
A5456D8523FC5B6E000BF18C /* globals_ctor.cpp */,
A5456D8F23FC5B72000BF18C /* globals_ctor.h */,
A5456D8423FC5B6D000BF18C /* globals_dtor.cpp */,
@ -15357,8 +15422,7 @@
A5456D8623FC5B6E000BF18C /* memory.h */,
A5456D8E23FC5B71000BF18C /* operatorNewDelete.cpp */,
A5456D8C23FC5B70000BF18C /* operatorNewDelete.h */,
A5456D8B23FC5B70000BF18C /* XStringW.cpp */,
A5456D8823FC5B6F000BF18C /* XStringW.h */,
A571C28A240574BB00B6A2C5 /* remove_ref.h */,
);
path = cpp_util;
sourceTree = "<group>";
@ -15679,6 +15743,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A571C28D240574DA00B6A2C5 /* XImage.cpp in Sources */,
A5AAFB26237F13B3009CD413 /* FwVol.c in Sources */,
A5AA0645237F13C2009CD413 /* ZeroMemWrapper.c in Sources */,
A5AAFBB2237F13B3009CD413 /* regenc.c in Sources */,
@ -16306,7 +16371,6 @@
A5AA06B3237F13C2009CD413 /* SetMem.nasm in Sources */,
A5AAFCCF237F13B4009CD413 /* UsbBotPeim.c in Sources */,
A5AAFB79237F13B3009CD413 /* EbcLowLevel.nasm in Sources */,
A5456D9423FC5B72000BF18C /* XStringW.cpp in Sources */,
A5AA072C237F13C2009CD413 /* CopyMem.nasm in Sources */,
A5AAFC36237F13B3009CD413 /* Terminal.c in Sources */,
A5456CDC23FC5A88000BF18C /* bootscreen.cpp in Sources */,
@ -16324,7 +16388,6 @@
A5AAFC95237F13B4009CD413 /* NvmExpressDiskInfo.c in Sources */,
A5AAFD16237F13B4009CD413 /* DxeFileExplorerProtocol.c in Sources */,
A5AA044D237F13C0009CD413 /* Nasm.inc in Sources */,
A5456D9223FC5B72000BF18C /* global1.cpp in Sources */,
A5AA06AD237F13C2009CD413 /* ScanMem64Wrapper.c in Sources */,
A5AAFBB0237F13B3009CD413 /* regparse.c in Sources */,
A5AAFCD5237F13B4009CD413 /* UsbMassBot.c in Sources */,
@ -17142,7 +17205,6 @@
A5AAFCC1237F13B4009CD413 /* ComponentName.c in Sources */,
A5456D5923FC5B08000BF18C /* picopng.cpp in Sources */,
A5AAFD65237F13B4009CD413 /* String.c in Sources */,
A5456D9523FC5B72000BF18C /* global2.cpp in Sources */,
A5AA0754237F13C3009CD413 /* ScanMem8Wrapper.c in Sources */,
A5AAFD03237F13B4009CD413 /* BmBoot.c in Sources */,
A5AA06BC237F13C2009CD413 /* ZeroMem.nasm in Sources */,

View File

@ -41,7 +41,9 @@ int XStringW_tests()
if ( str2 != L"a" ) return 20;
str2.SPrintf("%ls", L"ab"); // UTF16(32) string containing ascii char
if ( str2 != L"ab" ) return 21;
#ifdef _MSC_VER
#pragma warning(disable : 4066)
#endif
str2.SPrintf("%lc", L'Ň'); // signe UTF16(32) char. (2 bytes in total if UTF16)
if ( str2 != L"Ň" ) return 22;
str2.SPrintf("%s", "Ň"); // this is a UTF8 string 2 bytes long

View File

@ -27,8 +27,11 @@ void operator delete ( void* ptr ) noexcept
{
return FreePool(ptr);
}
void __cdecl operator delete(void * ptr, unsigned __int64 count)
#ifdef _MSC_VER
void _cdecl operator delete (void * ptr, unsigned __int64 count)
#else
void operator delete (void * ptr, UINTN count)
#endif
{
return FreePool(ptr);
}