diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template index 6a54ff98f..12b3e8901 100644 --- a/BaseTools/Conf/tools_def.template +++ b/BaseTools/Conf/tools_def.template @@ -2571,12 +2571,14 @@ RELEASE_XCODE8_*_MTOC_FLAGS = -align 0x20 DEBUG_XCODE8_X64_DLINK_FLAGS = -arch x86_64 -nostdlib -Wl,-u,_$(IMAGE_ENTRY_POINT),-e,_$(IMAGE_ENTRY_POINT),-preload,-segalign,0x20,-pie,-all_load,-dead_strip,-seg1addr,0x260,-map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map DEBUGMACOS_XCODE8_X64_DLINK_FLAGS = -arch x86_64 -nostdlib -Wl,-u,_$(IMAGE_ENTRY_POINT),-e,_$(IMAGE_ENTRY_POINT),-preload,-segalign,0x20,-pie,-all_load,-dead_strip,-seg1addr,0x800,-map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map RELEASE_XCODE8_X64_DLINK_FLAGS = -arch x86_64 -nostdlib -Wl,-u,_$(IMAGE_ENTRY_POINT),-e,_$(IMAGE_ENTRY_POINT),-preload,-segalign,0x20,-pie,-all_load,-dead_strip,-seg1addr,0x260,-map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map +RELEASEMACOS_XCODE8_X64_DLINK_FLAGS = -arch x86_64 -nostdlib -Wl,-u,_$(IMAGE_ENTRY_POINT),-e,_$(IMAGE_ENTRY_POINT),-preload,-segalign,0x20,-pie,-all_load,-dead_strip,-seg1addr,0x800,-map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map *_XCODE8_X64_SLINK_FLAGS = -static -no_warning_for_no_symbols -o DEBUG_XCODE8_X64_ASM_FLAGS = -c -x assembler -arch x86_64 -g DEBUGMACOS_XCODE8_X64_ASM_FLAGS = -c -x assembler -arch x86_64 -g RELEASE_XCODE8_X64_ASM_FLAGS = -c -x assembler -arch x86_64 + RELEASEMACOS_XCODE8_X64_ASM_FLAGS = -c -x assembler -arch x86_64 *_XCODE8_X64_NASM_FLAGS = -f macho64 *_XCODE8_*_PP_FLAGS = DEF(GCC_PP_FLAGS) @@ -2594,9 +2596,11 @@ RELEASE_XCODE8_*_MTOC_FLAGS = -align 0x20 DEBUG_XCODE8_X64_CC_FLAGS = -g -gdwarf -O0 DEF(XCODE8_COMMON_FLAGS) -target x86_64-pc-win32-macho "-DEFIAPI=__attribute__((ms_abi))" DEBUGMACOS_XCODE8_X64_CC_FLAGS = -g -gdwarf -O0 DEF(XCODE8_COMMON_FLAGS) RELEASE_XCODE8_X64_CC_FLAGS = -Os DEF(XCODE8_COMMON_FLAGS) -target x86_64-pc-win32-macho "-DEFIAPI=__attribute__((ms_abi))" -Werror + RELEASEMACOS_XCODE8_X64_CC_FLAGS = -Os DEF(XCODE8_COMMON_FLAGS) DEBUG_XCODE8_X64_CXX_FLAGS = -g -gdwarf -O0 DEF(XCODE8_COMMON_FLAGS) -target x86_64-pc-win32-macho "-DEFIAPI=__attribute__((ms_abi))" DEBUGMACOS_XCODE8_X64_CXX_FLAGS = -g -gdwarf -O0 DEF(XCODE8_COMMON_FLAGS) RELEASE_XCODE8_X64_CXX_FLAGS = -Os DEF(XCODE8_COMMON_FLAGS) -target x86_64-pc-win32-macho "-DEFIAPI=__attribute__((ms_abi))" -Werror + RELEASEMACOS_XCODE8_X64_CXX_FLAGS = -Os DEF(XCODE8_COMMON_FLAGS) *_XCODE8_*_ASLCC_FLAGS = -x c -save-temps -g -O0 -fshort-wchar -fno-strict-aliasing -Wall -Werror -c -include AutoGen.h *_XCODE8_*_ASLDLINK_FLAGS = -nostdlib -Wl,-e,_ReferenceAcpiTable,-preload,-segalign,0x20,-pie,-seg1addr,0x260,-read_only_relocs,suppress,-map,$(DEST_DIR_DEBUG)/$(BASE_NAME).map diff --git a/Clover.dsc b/Clover.dsc index e39f57fde..bee95eda1 100644 --- a/Clover.dsc +++ b/Clover.dsc @@ -22,7 +22,7 @@ DSC_SPECIFICATION = 0x00010006 OUTPUT_DIRECTORY = Build/Clover SUPPORTED_ARCHITECTURES = X64|IA32 - BUILD_TARGETS = RELEASE|DEBUG|DEBUGMACOS + BUILD_TARGETS = RELEASE|DEBUG|DEBUGMACOS|RELEASEMACOS SKUID_IDENTIFIER = DEFAULT !ifndef SKIP_FLASH FLASH_DEFINITION = Clover.fdf diff --git a/PosixCompilation/Libs/Autogen/AutoGen.c b/PosixCompilation/DEBUG_Libs/Autogen/AutoGen.c similarity index 100% rename from PosixCompilation/Libs/Autogen/AutoGen.c rename to PosixCompilation/DEBUG_Libs/Autogen/AutoGen.c diff --git a/PosixCompilation/Libs/Autogen/AutoGen.h b/PosixCompilation/DEBUG_Libs/Autogen/AutoGen.h similarity index 100% rename from PosixCompilation/Libs/Autogen/AutoGen.h rename to PosixCompilation/DEBUG_Libs/Autogen/AutoGen.h diff --git a/PosixCompilation/Libs/CloverEFI/MtrrLib.lib b/PosixCompilation/DEBUG_Libs/CloverEFI/MtrrLib.lib similarity index 100% rename from PosixCompilation/Libs/CloverEFI/MtrrLib.lib rename to PosixCompilation/DEBUG_Libs/CloverEFI/MtrrLib.lib diff --git a/PosixCompilation/Libs/Library/DuetTimerLib.lib b/PosixCompilation/DEBUG_Libs/Library/DuetTimerLib.lib similarity index 100% rename from PosixCompilation/Libs/Library/DuetTimerLib.lib rename to PosixCompilation/DEBUG_Libs/Library/DuetTimerLib.lib diff --git a/PosixCompilation/Libs/Library/HdaDevicesLib.lib b/PosixCompilation/DEBUG_Libs/Library/HdaDevicesLib.lib similarity index 100% rename from PosixCompilation/Libs/Library/HdaDevicesLib.lib rename to PosixCompilation/DEBUG_Libs/Library/HdaDevicesLib.lib diff --git a/PosixCompilation/Libs/Library/OpensslLib.lib b/PosixCompilation/DEBUG_Libs/Library/OpensslLib.lib similarity index 100% rename from PosixCompilation/Libs/Library/OpensslLib.lib rename to PosixCompilation/DEBUG_Libs/Library/OpensslLib.lib diff --git a/PosixCompilation/Libs/Library/VBoxPeCoffLib.lib b/PosixCompilation/DEBUG_Libs/Library/VBoxPeCoffLib.lib similarity index 100% rename from PosixCompilation/Libs/Library/VBoxPeCoffLib.lib rename to PosixCompilation/DEBUG_Libs/Library/VBoxPeCoffLib.lib diff --git a/PosixCompilation/Libs/Library/VideoBiosPatchLib.lib b/PosixCompilation/DEBUG_Libs/Library/VideoBiosPatchLib.lib similarity index 100% rename from PosixCompilation/Libs/Library/VideoBiosPatchLib.lib rename to PosixCompilation/DEBUG_Libs/Library/VideoBiosPatchLib.lib diff --git a/PosixCompilation/Libs/Library/WaveLib.lib b/PosixCompilation/DEBUG_Libs/Library/WaveLib.lib similarity index 100% rename from PosixCompilation/Libs/Library/WaveLib.lib rename to PosixCompilation/DEBUG_Libs/Library/WaveLib.lib diff --git a/PosixCompilation/Libs/MdeModulePkg/BasePlatformHookLibNull.lib b/PosixCompilation/DEBUG_Libs/MdeModulePkg/BasePlatformHookLibNull.lib similarity index 100% rename from PosixCompilation/Libs/MdeModulePkg/BasePlatformHookLibNull.lib rename to PosixCompilation/DEBUG_Libs/MdeModulePkg/BasePlatformHookLibNull.lib diff --git a/PosixCompilation/Libs/MdeModulePkg/BaseSerialPortLib16550.lib b/PosixCompilation/DEBUG_Libs/MdeModulePkg/BaseSerialPortLib16550.lib similarity index 100% rename from PosixCompilation/Libs/MdeModulePkg/BaseSerialPortLib16550.lib rename to PosixCompilation/DEBUG_Libs/MdeModulePkg/BaseSerialPortLib16550.lib diff --git a/PosixCompilation/Libs/MdeModulePkg/FrameBufferBltLib.lib b/PosixCompilation/DEBUG_Libs/MdeModulePkg/FrameBufferBltLib.lib similarity index 100% rename from PosixCompilation/Libs/MdeModulePkg/FrameBufferBltLib.lib rename to PosixCompilation/DEBUG_Libs/MdeModulePkg/FrameBufferBltLib.lib diff --git a/PosixCompilation/Libs/MdePkg/BaseCpuLib.lib b/PosixCompilation/DEBUG_Libs/MdePkg/BaseCpuLib.lib similarity index 100% rename from PosixCompilation/Libs/MdePkg/BaseCpuLib.lib rename to PosixCompilation/DEBUG_Libs/MdePkg/BaseCpuLib.lib diff --git a/PosixCompilation/Libs/MdePkg/BaseDebugLibSerialPort.lib b/PosixCompilation/DEBUG_Libs/MdePkg/BaseDebugLibSerialPort.lib similarity index 100% rename from PosixCompilation/Libs/MdePkg/BaseDebugLibSerialPort.lib rename to PosixCompilation/DEBUG_Libs/MdePkg/BaseDebugLibSerialPort.lib diff --git a/PosixCompilation/Libs/MdePkg/BaseDebugPrintErrorLevelLib.lib b/PosixCompilation/DEBUG_Libs/MdePkg/BaseDebugPrintErrorLevelLib.lib similarity index 100% rename from PosixCompilation/Libs/MdePkg/BaseDebugPrintErrorLevelLib.lib rename to PosixCompilation/DEBUG_Libs/MdePkg/BaseDebugPrintErrorLevelLib.lib diff --git a/PosixCompilation/Libs/MdePkg/BaseIoLibIntrinsic.lib b/PosixCompilation/DEBUG_Libs/MdePkg/BaseIoLibIntrinsic.lib similarity index 100% rename from PosixCompilation/Libs/MdePkg/BaseIoLibIntrinsic.lib rename to PosixCompilation/DEBUG_Libs/MdePkg/BaseIoLibIntrinsic.lib diff --git a/PosixCompilation/Libs/MdePkg/BaseLib.lib b/PosixCompilation/DEBUG_Libs/MdePkg/BaseLib.lib similarity index 100% rename from PosixCompilation/Libs/MdePkg/BaseLib.lib rename to PosixCompilation/DEBUG_Libs/MdePkg/BaseLib.lib diff --git a/PosixCompilation/Libs/MdePkg/BaseMemoryLib.lib b/PosixCompilation/DEBUG_Libs/MdePkg/BaseMemoryLib.lib similarity index 100% rename from PosixCompilation/Libs/MdePkg/BaseMemoryLib.lib rename to PosixCompilation/DEBUG_Libs/MdePkg/BaseMemoryLib.lib diff --git a/PosixCompilation/Libs/MdePkg/BasePciCf8Lib.lib b/PosixCompilation/DEBUG_Libs/MdePkg/BasePciCf8Lib.lib similarity index 100% rename from PosixCompilation/Libs/MdePkg/BasePciCf8Lib.lib rename to PosixCompilation/DEBUG_Libs/MdePkg/BasePciCf8Lib.lib diff --git a/PosixCompilation/Libs/MdePkg/BasePciLibCf8.lib b/PosixCompilation/DEBUG_Libs/MdePkg/BasePciLibCf8.lib similarity index 100% rename from PosixCompilation/Libs/MdePkg/BasePciLibCf8.lib rename to PosixCompilation/DEBUG_Libs/MdePkg/BasePciLibCf8.lib diff --git a/PosixCompilation/Libs/MdePkg/BasePrintLib.lib b/PosixCompilation/DEBUG_Libs/MdePkg/BasePrintLib.lib similarity index 100% rename from PosixCompilation/Libs/MdePkg/BasePrintLib.lib rename to PosixCompilation/DEBUG_Libs/MdePkg/BasePrintLib.lib diff --git a/PosixCompilation/Libs/MdePkg/DxeHobLib.lib b/PosixCompilation/DEBUG_Libs/MdePkg/DxeHobLib.lib similarity index 100% rename from PosixCompilation/Libs/MdePkg/DxeHobLib.lib rename to PosixCompilation/DEBUG_Libs/MdePkg/DxeHobLib.lib diff --git a/PosixCompilation/Libs/MdePkg/DxeServicesLib.lib b/PosixCompilation/DEBUG_Libs/MdePkg/DxeServicesLib.lib similarity index 100% rename from PosixCompilation/Libs/MdePkg/DxeServicesLib.lib rename to PosixCompilation/DEBUG_Libs/MdePkg/DxeServicesLib.lib diff --git a/PosixCompilation/Libs/MdePkg/DxeServicesTableLib.lib b/PosixCompilation/DEBUG_Libs/MdePkg/DxeServicesTableLib.lib similarity index 100% rename from PosixCompilation/Libs/MdePkg/DxeServicesTableLib.lib rename to PosixCompilation/DEBUG_Libs/MdePkg/DxeServicesTableLib.lib diff --git a/PosixCompilation/Libs/MdePkg/PeCoffExtraActionLibNull.lib b/PosixCompilation/DEBUG_Libs/MdePkg/PeCoffExtraActionLibNull.lib similarity index 100% rename from PosixCompilation/Libs/MdePkg/PeCoffExtraActionLibNull.lib rename to PosixCompilation/DEBUG_Libs/MdePkg/PeCoffExtraActionLibNull.lib diff --git a/PosixCompilation/Libs/MdePkg/UefiApplicationEntryPoint.lib b/PosixCompilation/DEBUG_Libs/MdePkg/UefiApplicationEntryPoint.lib similarity index 100% rename from PosixCompilation/Libs/MdePkg/UefiApplicationEntryPoint.lib rename to PosixCompilation/DEBUG_Libs/MdePkg/UefiApplicationEntryPoint.lib diff --git a/PosixCompilation/Libs/MdePkg/UefiBootServicesTableLib.lib b/PosixCompilation/DEBUG_Libs/MdePkg/UefiBootServicesTableLib.lib similarity index 100% rename from PosixCompilation/Libs/MdePkg/UefiBootServicesTableLib.lib rename to PosixCompilation/DEBUG_Libs/MdePkg/UefiBootServicesTableLib.lib diff --git a/PosixCompilation/Libs/MdePkg/UefiDevicePathLib.lib b/PosixCompilation/DEBUG_Libs/MdePkg/UefiDevicePathLib.lib similarity index 100% rename from PosixCompilation/Libs/MdePkg/UefiDevicePathLib.lib rename to PosixCompilation/DEBUG_Libs/MdePkg/UefiDevicePathLib.lib diff --git a/PosixCompilation/Libs/MdePkg/UefiFileHandleLib.lib b/PosixCompilation/DEBUG_Libs/MdePkg/UefiFileHandleLib.lib similarity index 100% rename from PosixCompilation/Libs/MdePkg/UefiFileHandleLib.lib rename to PosixCompilation/DEBUG_Libs/MdePkg/UefiFileHandleLib.lib diff --git a/PosixCompilation/Libs/MdePkg/UefiLib.lib b/PosixCompilation/DEBUG_Libs/MdePkg/UefiLib.lib similarity index 100% rename from PosixCompilation/Libs/MdePkg/UefiLib.lib rename to PosixCompilation/DEBUG_Libs/MdePkg/UefiLib.lib diff --git a/PosixCompilation/Libs/MdePkg/UefiMemoryAllocationLib.lib b/PosixCompilation/DEBUG_Libs/MdePkg/UefiMemoryAllocationLib.lib similarity index 100% rename from PosixCompilation/Libs/MdePkg/UefiMemoryAllocationLib.lib rename to PosixCompilation/DEBUG_Libs/MdePkg/UefiMemoryAllocationLib.lib diff --git a/PosixCompilation/Libs/MdePkg/UefiRuntimeServicesTableLib.lib b/PosixCompilation/DEBUG_Libs/MdePkg/UefiRuntimeServicesTableLib.lib similarity index 100% rename from PosixCompilation/Libs/MdePkg/UefiRuntimeServicesTableLib.lib rename to PosixCompilation/DEBUG_Libs/MdePkg/UefiRuntimeServicesTableLib.lib diff --git a/PosixCompilation/Libs/OC/ControlMsrE2.lib b/PosixCompilation/DEBUG_Libs/OC/ControlMsrE2.lib similarity index 100% rename from PosixCompilation/Libs/OC/ControlMsrE2.lib rename to PosixCompilation/DEBUG_Libs/OC/ControlMsrE2.lib diff --git a/PosixCompilation/Libs/OC/OcAcpiLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcAcpiLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcAcpiLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcAcpiLib.lib diff --git a/PosixCompilation/Libs/OC/OcAfterBootCompatLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcAfterBootCompatLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcAfterBootCompatLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcAfterBootCompatLib.lib diff --git a/PosixCompilation/Libs/OC/OcApfsLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcApfsLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcApfsLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcApfsLib.lib diff --git a/PosixCompilation/Libs/OC/OcAppleBootPolicyLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcAppleBootPolicyLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcAppleBootPolicyLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcAppleBootPolicyLib.lib diff --git a/PosixCompilation/Libs/OC/OcAppleChunklistLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcAppleChunklistLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcAppleChunklistLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcAppleChunklistLib.lib diff --git a/PosixCompilation/Libs/OC/OcAppleDiskImageLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcAppleDiskImageLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcAppleDiskImageLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcAppleDiskImageLib.lib diff --git a/PosixCompilation/Libs/OC/OcAppleEventLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcAppleEventLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcAppleEventLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcAppleEventLib.lib diff --git a/PosixCompilation/Libs/OC/OcAppleImageVerificationLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcAppleImageVerificationLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcAppleImageVerificationLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcAppleImageVerificationLib.lib diff --git a/PosixCompilation/Libs/OC/OcAppleImg4Lib.lib b/PosixCompilation/DEBUG_Libs/OC/OcAppleImg4Lib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcAppleImg4Lib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcAppleImg4Lib.lib diff --git a/PosixCompilation/Libs/OC/OcAppleKernelLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcAppleKernelLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcAppleKernelLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcAppleKernelLib.lib diff --git a/PosixCompilation/Libs/OC/OcAppleKeyMapLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcAppleKeyMapLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcAppleKeyMapLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcAppleKeyMapLib.lib diff --git a/PosixCompilation/Libs/OC/OcAppleKeysLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcAppleKeysLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcAppleKeysLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcAppleKeysLib.lib diff --git a/PosixCompilation/Libs/OC/OcAppleRamDiskLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcAppleRamDiskLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcAppleRamDiskLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcAppleRamDiskLib.lib diff --git a/PosixCompilation/Libs/OC/OcAppleSecureBootLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcAppleSecureBootLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcAppleSecureBootLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcAppleSecureBootLib.lib diff --git a/PosixCompilation/Libs/OC/OcAppleUserInterfaceThemeLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcAppleUserInterfaceThemeLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcAppleUserInterfaceThemeLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcAppleUserInterfaceThemeLib.lib diff --git a/PosixCompilation/Libs/OC/OcAudioLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcAudioLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcAudioLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcAudioLib.lib diff --git a/PosixCompilation/Libs/OC/OcBootManagementLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcBootManagementLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcBootManagementLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcBootManagementLib.lib diff --git a/PosixCompilation/Libs/OC/OcCompressionLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcCompressionLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcCompressionLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcCompressionLib.lib diff --git a/PosixCompilation/Libs/OC/OcConfigurationLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcConfigurationLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcConfigurationLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcConfigurationLib.lib diff --git a/PosixCompilation/Libs/OC/OcConsoleLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcConsoleLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcConsoleLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcConsoleLib.lib diff --git a/PosixCompilation/Libs/OC/OcCpuLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcCpuLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcCpuLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcCpuLib.lib diff --git a/PosixCompilation/Libs/OC/OcCryptoLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcCryptoLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcCryptoLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcCryptoLib.lib diff --git a/PosixCompilation/Libs/OC/OcDataHubLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcDataHubLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcDataHubLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcDataHubLib.lib diff --git a/PosixCompilation/Libs/OC/OcDebugLogLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcDebugLogLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcDebugLogLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcDebugLogLib.lib diff --git a/PosixCompilation/Libs/OC/OcDevicePathLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcDevicePathLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcDevicePathLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcDevicePathLib.lib diff --git a/PosixCompilation/Libs/OC/OcDevicePropertyLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcDevicePropertyLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcDevicePropertyLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcDevicePropertyLib.lib diff --git a/PosixCompilation/Libs/OC/OcDeviceTreeLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcDeviceTreeLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcDeviceTreeLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcDeviceTreeLib.lib diff --git a/PosixCompilation/Libs/OC/OcDriverConnectionLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcDriverConnectionLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcDriverConnectionLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcDriverConnectionLib.lib diff --git a/PosixCompilation/Libs/OC/OcFileLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcFileLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcFileLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcFileLib.lib diff --git a/PosixCompilation/Libs/OC/OcFirmwareVolumeLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcFirmwareVolumeLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcFirmwareVolumeLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcFirmwareVolumeLib.lib diff --git a/PosixCompilation/Libs/OC/OcGuardLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcGuardLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcGuardLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcGuardLib.lib diff --git a/PosixCompilation/Libs/OC/OcHashServicesLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcHashServicesLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcHashServicesLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcHashServicesLib.lib diff --git a/PosixCompilation/Libs/OC/OcInputLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcInputLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcInputLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcInputLib.lib diff --git a/PosixCompilation/Libs/OC/OcMacInfoLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcMacInfoLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcMacInfoLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcMacInfoLib.lib diff --git a/PosixCompilation/Libs/OC/OcMachoLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcMachoLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcMachoLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcMachoLib.lib diff --git a/PosixCompilation/Libs/OC/OcMemoryLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcMemoryLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcMemoryLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcMemoryLib.lib diff --git a/PosixCompilation/Libs/OC/OcMiscLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcMiscLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcMiscLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcMiscLib.lib diff --git a/PosixCompilation/Libs/OC/OcOSInfoLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcOSInfoLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcOSInfoLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcOSInfoLib.lib diff --git a/PosixCompilation/Libs/OC/OcPeCoffLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcPeCoffLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcPeCoffLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcPeCoffLib.lib diff --git a/PosixCompilation/Libs/OC/OcRngLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcRngLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcRngLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcRngLib.lib diff --git a/PosixCompilation/Libs/OC/OcRtcLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcRtcLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcRtcLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcRtcLib.lib diff --git a/PosixCompilation/Libs/OC/OcSerializeLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcSerializeLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcSerializeLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcSerializeLib.lib diff --git a/PosixCompilation/Libs/OC/OcSmbiosLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcSmbiosLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcSmbiosLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcSmbiosLib.lib diff --git a/PosixCompilation/Libs/OC/OcSmcLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcSmcLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcSmcLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcSmcLib.lib diff --git a/PosixCompilation/Libs/OC/OcStorageLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcStorageLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcStorageLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcStorageLib.lib diff --git a/PosixCompilation/Libs/OC/OcStringLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcStringLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcStringLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcStringLib.lib diff --git a/PosixCompilation/Libs/OC/OcTemplateLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcTemplateLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcTemplateLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcTemplateLib.lib diff --git a/PosixCompilation/Libs/OC/OcUnicodeCollationEngGenericLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcUnicodeCollationEngGenericLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcUnicodeCollationEngGenericLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcUnicodeCollationEngGenericLib.lib diff --git a/PosixCompilation/Libs/OC/OcVirtualFsLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcVirtualFsLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcVirtualFsLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcVirtualFsLib.lib diff --git a/PosixCompilation/Libs/OC/OcXmlLib.lib b/PosixCompilation/DEBUG_Libs/OC/OcXmlLib.lib similarity index 100% rename from PosixCompilation/Libs/OC/OcXmlLib.lib rename to PosixCompilation/DEBUG_Libs/OC/OcXmlLib.lib diff --git a/PosixCompilation/Libs/OC/OpenCore.lib b/PosixCompilation/DEBUG_Libs/OC/OpenCore.lib similarity index 100% rename from PosixCompilation/Libs/OC/OpenCore.lib rename to PosixCompilation/DEBUG_Libs/OC/OpenCore.lib diff --git a/PosixCompilation/Libs/OC/OpenRuntime.lib b/PosixCompilation/DEBUG_Libs/OC/OpenRuntime.lib similarity index 100% rename from PosixCompilation/Libs/OC/OpenRuntime.lib rename to PosixCompilation/DEBUG_Libs/OC/OpenRuntime.lib diff --git a/PosixCompilation/RELEASE_Libs/Autogen/AutoGen.c b/PosixCompilation/RELEASE_Libs/Autogen/AutoGen.c new file mode 120000 index 000000000..547895222 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/Autogen/AutoGen.c @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/rEFIt_UEFI/refit/DEBUG/AutoGen.c \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/Autogen/AutoGen.h b/PosixCompilation/RELEASE_Libs/Autogen/AutoGen.h new file mode 120000 index 000000000..e307b28c3 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/Autogen/AutoGen.h @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/rEFIt_UEFI/refit/DEBUG/AutoGen.h \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/CloverEFI/MtrrLib.lib b/PosixCompilation/RELEASE_Libs/CloverEFI/MtrrLib.lib new file mode 120000 index 000000000..da6ddd359 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/CloverEFI/MtrrLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/CloverEFI/UefiCpuPkg/Library/MtrrLib/MtrrLib/OUTPUT/MtrrLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/Library/DuetTimerLib.lib b/PosixCompilation/RELEASE_Libs/Library/DuetTimerLib.lib new file mode 120000 index 000000000..dfa51b59f --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/Library/DuetTimerLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/Library/DuetTimerLib/DuetTimerLib/OUTPUT/DuetTimerLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/Library/HdaDevicesLib.lib b/PosixCompilation/RELEASE_Libs/Library/HdaDevicesLib.lib new file mode 120000 index 000000000..ffec1e3fe --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/Library/HdaDevicesLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/Library/HdaDevicesLib/HdaDevicesLib/OUTPUT/HdaDevicesLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/Library/OpensslLib.lib b/PosixCompilation/RELEASE_Libs/Library/OpensslLib.lib new file mode 120000 index 000000000..6150daf10 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/Library/OpensslLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/Library/OpensslLib/OpensslLibNull/OUTPUT/OpensslLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/Library/VBoxPeCoffLib.lib b/PosixCompilation/RELEASE_Libs/Library/VBoxPeCoffLib.lib new file mode 120000 index 000000000..0cb3a3e5b --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/Library/VBoxPeCoffLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/Library/VBoxPeCoffLib/VBoxPeCoffLib/OUTPUT/VBoxPeCoffLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/Library/VideoBiosPatchLib.lib b/PosixCompilation/RELEASE_Libs/Library/VideoBiosPatchLib.lib new file mode 120000 index 000000000..688fd9b82 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/Library/VideoBiosPatchLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/Library/VideoBiosPatchLib/VideoBiosPatchLib/OUTPUT/VideoBiosPatchLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/Library/WaveLib.lib b/PosixCompilation/RELEASE_Libs/Library/WaveLib.lib new file mode 120000 index 000000000..90928fec5 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/Library/WaveLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/Library/WaveLib/WaveLib/OUTPUT/WaveLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/MdeModulePkg/BasePlatformHookLibNull.lib b/PosixCompilation/RELEASE_Libs/MdeModulePkg/BasePlatformHookLibNull.lib new file mode 120000 index 000000000..2f6beda3c --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/MdeModulePkg/BasePlatformHookLibNull.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatformHookLibNull/OUTPUT/BasePlatformHookLibNull.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/MdeModulePkg/FrameBufferBltLib.lib b/PosixCompilation/RELEASE_Libs/MdeModulePkg/FrameBufferBltLib.lib new file mode 120000 index 000000000..29be7c1b8 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/MdeModulePkg/FrameBufferBltLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib/OUTPUT/FrameBufferBltLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/MdePkg/BaseCpuLib.lib b/PosixCompilation/RELEASE_Libs/MdePkg/BaseCpuLib.lib new file mode 120000 index 000000000..9cf91af89 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/MdePkg/BaseCpuLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/MdePkg/Library/BaseCpuLib/BaseCpuLib/OUTPUT/BaseCpuLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/MdePkg/BaseDebugLibNull.lib b/PosixCompilation/RELEASE_Libs/MdePkg/BaseDebugLibNull.lib new file mode 120000 index 000000000..099847dfd --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/MdePkg/BaseDebugLibNull.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull/OUTPUT/BaseDebugLibNull.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/MdePkg/BaseDebugPrintErrorLevelLib.lib b/PosixCompilation/RELEASE_Libs/MdePkg/BaseDebugPrintErrorLevelLib.lib new file mode 120000 index 000000000..16cab1c83 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/MdePkg/BaseDebugPrintErrorLevelLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib/OUTPUT/BaseDebugPrintErrorLevelLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/MdePkg/BaseIoLibIntrinsic.lib b/PosixCompilation/RELEASE_Libs/MdePkg/BaseIoLibIntrinsic.lib new file mode 120000 index 000000000..6b030e610 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/MdePkg/BaseIoLibIntrinsic.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic/OUTPUT/BaseIoLibIntrinsic.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/MdePkg/BaseLib.lib b/PosixCompilation/RELEASE_Libs/MdePkg/BaseLib.lib new file mode 120000 index 000000000..28d176ad7 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/MdePkg/BaseLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/MdePkg/Library/BaseLib/BaseLib/OUTPUT/BaseLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/MdePkg/BaseMemoryLib.lib b/PosixCompilation/RELEASE_Libs/MdePkg/BaseMemoryLib.lib new file mode 120000 index 000000000..58310d0ea --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/MdePkg/BaseMemoryLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/MdePkg/Library/BaseMemoryLib/BaseMemoryLib/OUTPUT/BaseMemoryLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/MdePkg/BasePciCf8Lib.lib b/PosixCompilation/RELEASE_Libs/MdePkg/BasePciCf8Lib.lib new file mode 120000 index 000000000..e4f5c4383 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/MdePkg/BasePciCf8Lib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib/OUTPUT/BasePciCf8Lib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/MdePkg/BasePciLibCf8.lib b/PosixCompilation/RELEASE_Libs/MdePkg/BasePciLibCf8.lib new file mode 120000 index 000000000..5d7d5634d --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/MdePkg/BasePciLibCf8.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/MdePkg/Library/BasePciLibCf8/BasePciLibCf8/OUTPUT/BasePciLibCf8.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/MdePkg/BasePrintLib.lib b/PosixCompilation/RELEASE_Libs/MdePkg/BasePrintLib.lib new file mode 120000 index 000000000..eba9bad3d --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/MdePkg/BasePrintLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/MdePkg/Library/BasePrintLib/BasePrintLib/OUTPUT/BasePrintLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/MdePkg/BaseSerialPortLibNull.lib b/PosixCompilation/RELEASE_Libs/MdePkg/BaseSerialPortLibNull.lib new file mode 120000 index 000000000..032818023 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/MdePkg/BaseSerialPortLibNull.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull/OUTPUT/BaseSerialPortLibNull.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/MdePkg/DxeHobLib.lib b/PosixCompilation/RELEASE_Libs/MdePkg/DxeHobLib.lib new file mode 120000 index 000000000..5f40799c7 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/MdePkg/DxeHobLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/MdePkg/Library/DxeHobLib/DxeHobLib/OUTPUT/DxeHobLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/MdePkg/DxeServicesLib.lib b/PosixCompilation/RELEASE_Libs/MdePkg/DxeServicesLib.lib new file mode 120000 index 000000000..0f768c526 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/MdePkg/DxeServicesLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/MdePkg/Library/DxeServicesLib/DxeServicesLib/OUTPUT/DxeServicesLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/MdePkg/DxeServicesTableLib.lib b/PosixCompilation/RELEASE_Libs/MdePkg/DxeServicesTableLib.lib new file mode 120000 index 000000000..c2ab54f4a --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/MdePkg/DxeServicesTableLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib/OUTPUT/DxeServicesTableLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/MdePkg/PeCoffExtraActionLibNull.lib b/PosixCompilation/RELEASE_Libs/MdePkg/PeCoffExtraActionLibNull.lib new file mode 120000 index 000000000..22c612d73 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/MdePkg/PeCoffExtraActionLibNull.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull/OUTPUT/PeCoffExtraActionLibNull.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/MdePkg/UefiApplicationEntryPoint.lib b/PosixCompilation/RELEASE_Libs/MdePkg/UefiApplicationEntryPoint.lib new file mode 120000 index 000000000..dc75f2abe --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/MdePkg/UefiApplicationEntryPoint.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint/OUTPUT/UefiApplicationEntryPoint.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/MdePkg/UefiBootServicesTableLib.lib b/PosixCompilation/RELEASE_Libs/MdePkg/UefiBootServicesTableLib.lib new file mode 120000 index 000000000..586372b18 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/MdePkg/UefiBootServicesTableLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib/OUTPUT/UefiBootServicesTableLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/MdePkg/UefiDevicePathLib.lib b/PosixCompilation/RELEASE_Libs/MdePkg/UefiDevicePathLib.lib new file mode 120000 index 000000000..4f6bb074b --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/MdePkg/UefiDevicePathLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib/OUTPUT/UefiDevicePathLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/MdePkg/UefiFileHandleLib.lib b/PosixCompilation/RELEASE_Libs/MdePkg/UefiFileHandleLib.lib new file mode 120000 index 000000000..51ccd107d --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/MdePkg/UefiFileHandleLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib/OUTPUT/UefiFileHandleLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/MdePkg/UefiLib.lib b/PosixCompilation/RELEASE_Libs/MdePkg/UefiLib.lib new file mode 120000 index 000000000..c57956994 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/MdePkg/UefiLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/MdePkg/Library/UefiLib/UefiLib/OUTPUT/UefiLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/MdePkg/UefiMemoryAllocationLib.lib b/PosixCompilation/RELEASE_Libs/MdePkg/UefiMemoryAllocationLib.lib new file mode 120000 index 000000000..9db83569b --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/MdePkg/UefiMemoryAllocationLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib/OUTPUT/UefiMemoryAllocationLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/MdePkg/UefiRuntimeServicesTableLib.lib b/PosixCompilation/RELEASE_Libs/MdePkg/UefiRuntimeServicesTableLib.lib new file mode 120000 index 000000000..effd6f335 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/MdePkg/UefiRuntimeServicesTableLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib/OUTPUT/UefiRuntimeServicesTableLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/ControlMsrE2.lib b/PosixCompilation/RELEASE_Libs/OC/ControlMsrE2.lib new file mode 120000 index 000000000..74c724879 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/ControlMsrE2.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Application/ControlMsrE2/ControlMsrE2/OUTPUT/ControlMsrE2.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcAcpiLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcAcpiLib.lib new file mode 120000 index 000000000..4c34821cd --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcAcpiLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcAcpiLib/OcAcpiLib/OUTPUT/OcAcpiLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcAfterBootCompatLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcAfterBootCompatLib.lib new file mode 120000 index 000000000..9bf9c0dae --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcAfterBootCompatLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcAfterBootCompatLib/OcAfterBootCompatLib/OUTPUT/OcAfterBootCompatLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcApfsLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcApfsLib.lib new file mode 120000 index 000000000..c8dac94cf --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcApfsLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcApfsLib/OcApfsLib/OUTPUT/OcApfsLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcAppleBootPolicyLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcAppleBootPolicyLib.lib new file mode 120000 index 000000000..93fc41660 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcAppleBootPolicyLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcAppleBootPolicyLib/OcAppleBootPolicyLib/OUTPUT/OcAppleBootPolicyLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcAppleChunklistLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcAppleChunklistLib.lib new file mode 120000 index 000000000..ea1249f4c --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcAppleChunklistLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcAppleChunklistLib/OcAppleChunklistLib/OUTPUT/OcAppleChunklistLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcAppleDiskImageLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcAppleDiskImageLib.lib new file mode 120000 index 000000000..6578af16a --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcAppleDiskImageLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcAppleDiskImageLib/OcAppleDiskImageLib/OUTPUT/OcAppleDiskImageLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcAppleEventLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcAppleEventLib.lib new file mode 120000 index 000000000..dab170dc0 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcAppleEventLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcAppleEventLib/OcAppleEventLib/OUTPUT/OcAppleEventLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcAppleImageVerificationLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcAppleImageVerificationLib.lib new file mode 120000 index 000000000..2735976fb --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcAppleImageVerificationLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcAppleImageVerificationLib/OcAppleImageVerificationLib/OUTPUT/OcAppleImageVerificationLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcAppleImg4Lib.lib b/PosixCompilation/RELEASE_Libs/OC/OcAppleImg4Lib.lib new file mode 120000 index 000000000..f08739766 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcAppleImg4Lib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcAppleImg4Lib/OcAppleImg4Lib/OUTPUT/OcAppleImg4Lib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcAppleKernelLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcAppleKernelLib.lib new file mode 120000 index 000000000..4a09f710d --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcAppleKernelLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcAppleKernelLib/OcAppleKernelLib/OUTPUT/OcAppleKernelLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcAppleKeyMapLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcAppleKeyMapLib.lib new file mode 120000 index 000000000..22ea9a803 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcAppleKeyMapLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcAppleKeyMapLib/OcAppleKeyMapLib/OUTPUT/OcAppleKeyMapLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcAppleKeysLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcAppleKeysLib.lib new file mode 120000 index 000000000..303990f89 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcAppleKeysLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcAppleKeysLib/OcAppleKeysLib/OUTPUT/OcAppleKeysLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcAppleRamDiskLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcAppleRamDiskLib.lib new file mode 120000 index 000000000..6d1300ec1 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcAppleRamDiskLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcAppleRamDiskLib/OcAppleRamDiskLib/OUTPUT/OcAppleRamDiskLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcAppleSecureBootLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcAppleSecureBootLib.lib new file mode 120000 index 000000000..949fbebca --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcAppleSecureBootLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcAppleSecureBootLib/OcAppleSecureBootLib/OUTPUT/OcAppleSecureBootLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcAppleUserInterfaceThemeLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcAppleUserInterfaceThemeLib.lib new file mode 120000 index 000000000..78bb9cf67 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcAppleUserInterfaceThemeLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcAppleUserInterfaceThemeLib/OcAppleUserInterfaceThemeLib/OUTPUT/OcAppleUserInterfaceThemeLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcAudioLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcAudioLib.lib new file mode 120000 index 000000000..7de846e06 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcAudioLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcAudioLib/OcAudioLib/OUTPUT/OcAudioLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcBootManagementLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcBootManagementLib.lib new file mode 120000 index 000000000..150492e65 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcBootManagementLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcBootManagementLib/OcBootManagementLib/OUTPUT/OcBootManagementLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcCompressionLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcCompressionLib.lib new file mode 120000 index 000000000..2cbfbc9fa --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcCompressionLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcCompressionLib/OcCompressionLib/OUTPUT/OcCompressionLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcConfigurationLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcConfigurationLib.lib new file mode 120000 index 000000000..82fc20ce0 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcConfigurationLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcConfigurationLib/OcConfigurationLib/OUTPUT/OcConfigurationLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcConsoleLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcConsoleLib.lib new file mode 120000 index 000000000..8d650ebea --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcConsoleLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcConsoleLib/OcConsoleLib/OUTPUT/OcConsoleLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcCpuLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcCpuLib.lib new file mode 120000 index 000000000..d3d8cb049 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcCpuLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcCpuLib/OcCpuLib/OUTPUT/OcCpuLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcCryptoLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcCryptoLib.lib new file mode 120000 index 000000000..0c8112c9e --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcCryptoLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcCryptoLib/OcCryptoLib/OUTPUT/OcCryptoLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcDataHubLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcDataHubLib.lib new file mode 120000 index 000000000..36e2bfbee --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcDataHubLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcDataHubLib/OcDataHubLib/OUTPUT/OcDataHubLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcDebugLogLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcDebugLogLib.lib new file mode 120000 index 000000000..164de09a0 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcDebugLogLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcDebugLogLibOc2Clover/OcDebugLogLibOc2Clover/OUTPUT/OcDebugLogLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcDevicePathLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcDevicePathLib.lib new file mode 120000 index 000000000..6b93fead0 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcDevicePathLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcDevicePathLib/OcDevicePathLib/OUTPUT/OcDevicePathLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcDevicePropertyLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcDevicePropertyLib.lib new file mode 120000 index 000000000..a8cded3c3 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcDevicePropertyLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcDevicePropertyLib/OcDevicePropertyLib/OUTPUT/OcDevicePropertyLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcDeviceTreeLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcDeviceTreeLib.lib new file mode 120000 index 000000000..cae93783b --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcDeviceTreeLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcDeviceTreeLib/OcDeviceTreeLib/OUTPUT/OcDeviceTreeLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcDriverConnectionLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcDriverConnectionLib.lib new file mode 120000 index 000000000..6904eb2f8 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcDriverConnectionLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcDriverConnectionLib/OcDriverConnectionLib/OUTPUT/OcDriverConnectionLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcFileLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcFileLib.lib new file mode 120000 index 000000000..c7de53f2a --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcFileLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcFileLib/OcFileLib/OUTPUT/OcFileLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcFirmwareVolumeLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcFirmwareVolumeLib.lib new file mode 120000 index 000000000..0c78e2c08 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcFirmwareVolumeLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcFirmwareVolumeLib/OcFirmwareVolumeLib/OUTPUT/OcFirmwareVolumeLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcGuardLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcGuardLib.lib new file mode 120000 index 000000000..69e5d9c15 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcGuardLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcGuardLib/OcGuardLib/OUTPUT/OcGuardLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcHashServicesLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcHashServicesLib.lib new file mode 120000 index 000000000..82880455b --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcHashServicesLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcHashServicesLib/OcHashServicesLib/OUTPUT/OcHashServicesLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcInputLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcInputLib.lib new file mode 120000 index 000000000..30472f121 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcInputLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcInputLib/OcInputLib/OUTPUT/OcInputLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcMacInfoLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcMacInfoLib.lib new file mode 120000 index 000000000..b0bd1b456 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcMacInfoLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcMacInfoLib/OcMacInfoLib/OUTPUT/OcMacInfoLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcMachoLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcMachoLib.lib new file mode 120000 index 000000000..2f52a3c56 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcMachoLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcMachoLib/OcMachoLib/OUTPUT/OcMachoLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcMemoryLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcMemoryLib.lib new file mode 120000 index 000000000..5ce3cf6e8 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcMemoryLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcMemoryLib/OcMemoryLib/OUTPUT/OcMemoryLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcMiscLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcMiscLib.lib new file mode 120000 index 000000000..5ae0ea5ad --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcMiscLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcMiscLib/OcMiscLib/OUTPUT/OcMiscLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcOSInfoLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcOSInfoLib.lib new file mode 120000 index 000000000..b5e0b9f23 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcOSInfoLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcOSInfoLib/OcOSInfoLib/OUTPUT/OcOSInfoLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcPeCoffLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcPeCoffLib.lib new file mode 120000 index 000000000..2a62e5905 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcPeCoffLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcPeCoffLib/OcPeCoffLib/OUTPUT/OcPeCoffLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcRngLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcRngLib.lib new file mode 120000 index 000000000..a61aaa3c5 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcRngLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcRngLib/OcRngLib/OUTPUT/OcRngLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcRtcLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcRtcLib.lib new file mode 120000 index 000000000..9918e7f5a --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcRtcLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcRtcLib/OcRtcLib/OUTPUT/OcRtcLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcSerializeLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcSerializeLib.lib new file mode 120000 index 000000000..11f3b46af --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcSerializeLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcSerializeLib/OcSerializeLib/OUTPUT/OcSerializeLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcSmbiosLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcSmbiosLib.lib new file mode 120000 index 000000000..548afd3c8 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcSmbiosLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcSmbiosLib/OcSmbiosLib/OUTPUT/OcSmbiosLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcSmcLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcSmcLib.lib new file mode 120000 index 000000000..7138b8547 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcSmcLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcSmcLib/OcSmcLib/OUTPUT/OcSmcLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcStorageLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcStorageLib.lib new file mode 120000 index 000000000..8b2763b1f --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcStorageLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcStorageLib/OcStorageLib/OUTPUT/OcStorageLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcStringLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcStringLib.lib new file mode 120000 index 000000000..3f3e2c7fd --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcStringLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcStringLib/OcStringLib/OUTPUT/OcStringLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcTemplateLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcTemplateLib.lib new file mode 120000 index 000000000..314cd7a89 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcTemplateLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcTemplateLib/OcTemplateLib/OUTPUT/OcTemplateLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcUnicodeCollationEngGenericLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcUnicodeCollationEngGenericLib.lib new file mode 120000 index 000000000..e6d75120b --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcUnicodeCollationEngGenericLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcUnicodeCollationEngLib/OcUnicodeCollationEngGenericLib/OUTPUT/OcUnicodeCollationEngGenericLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcVirtualFsLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcVirtualFsLib.lib new file mode 120000 index 000000000..798a09933 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcVirtualFsLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcVirtualFsLib/OcVirtualFsLib/OUTPUT/OcVirtualFsLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OcXmlLib.lib b/PosixCompilation/RELEASE_Libs/OC/OcXmlLib.lib new file mode 120000 index 000000000..11a0a297b --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OcXmlLib.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Library/OcXmlLib/OcXmlLib/OUTPUT/OcXmlLib.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OpenCore.lib b/PosixCompilation/RELEASE_Libs/OC/OpenCore.lib new file mode 120000 index 000000000..b6f5813a1 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OpenCore.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Platform/OpenCore/OpenCoreLib/OUTPUT/OpenCore.lib \ No newline at end of file diff --git a/PosixCompilation/RELEASE_Libs/OC/OpenRuntime.lib b/PosixCompilation/RELEASE_Libs/OC/OpenRuntime.lib new file mode 120000 index 000000000..361c3a104 --- /dev/null +++ b/PosixCompilation/RELEASE_Libs/OC/OpenRuntime.lib @@ -0,0 +1 @@ +../../../Build/Clover/RELEASEMACOS_XCODE8/X64/OpenCorePkg/Platform/OpenRuntime/OpenRuntime/OUTPUT/OpenRuntime.lib \ No newline at end of file diff --git a/PosixCompilation/UefiMock/Library/DebugLib.c b/PosixCompilation/UefiMock/Library/DebugLib.c index 007e7fcca..262ffe0d5 100644 --- a/PosixCompilation/UefiMock/Library/DebugLib.c +++ b/PosixCompilation/UefiMock/Library/DebugLib.c @@ -94,13 +94,15 @@ DebugCodeEnabled ( return TRUE; } +BOOLEAN gDebugPrintEnabled = 0; + BOOLEAN EFIAPI DebugPrintEnabled ( VOID ) { - return TRUE; + return gDebugPrintEnabled; } BOOLEAN diff --git a/PosixCompilation/relink_release_libs b/PosixCompilation/relink_release_libs new file mode 100755 index 000000000..acf8d51e6 --- /dev/null +++ b/PosixCompilation/relink_release_libs @@ -0,0 +1,46 @@ +#!/bin/bash +SCRIPT_ABS_FILENAME=`LC_ALL=en_US.ISO8859-1 perl -e 'use Cwd "abs_path";print abs_path(shift)' "${BASH_SOURCE[0]}"` +SCRIPT_DIR=`dirname "$SCRIPT_ABS_FILENAME"` + + + + +find RELEASE_Libs -type l -print0 | +while read -d $'\0' file +do + #echo "$file" + rm "$file" +done + + + + + + + +find DEBUG_Libs -type l -print0 | +while read -d $'\0' file +do + #echo "$file" + target="$(stat -f %Y "$file")" + if [[ "$file" == *BaseDebugLibSerialPort* ]] + then + file="${file//BaseDebugLibSerialPort/BaseDebugLibNull}" + target="${target//BaseDebugLibSerialPort/BaseDebugLibNull}" + fi + if [[ "$file" == *BaseSerialPortLib16550* ]] + then + file="${file//BaseSerialPortLib16550/BaseSerialPortLibNull}" + target="${target//BaseSerialPortLib16550/BaseSerialPortLibNull}" + file="${file//MdeModulePkg/MdePkg}" + target="${target//MdeModulePkg/MdePkg}" + fi + cmdArgs=() + cmdArgs=( ln -s "${target//DEBUGMACOS_XCODE8/RELEASEMACOS_XCODE8}" "${file//DEBUG_Libs/RELEASE_Libs}" ) + echo "${cmdArgs[@]}" + "${cmdArgs[@]}" +done + + + +# xargs -0 echo '$(stat -f %Y {})' \; diff --git a/rEFIt_UEFI/Platform/APFS.h b/rEFIt_UEFI/Platform/APFS.h index 317a9b85f..0e39f7298 100644 --- a/rEFIt_UEFI/Platform/APFS.h +++ b/rEFIt_UEFI/Platform/APFS.h @@ -12,7 +12,7 @@ extern "C" { #include } -constexpr LString8 ApfsSignatureUUID = "BE74FCF7-0B7C-49F3-9147-01F4042E6842"; +constexpr LString8 ApfsSignatureUUID = "BE74FCF7-0B7C-49F3-9147-01F4042E6842"_XS8; /* * Function for obtaining unique part id from APFS partition diff --git a/rEFIt_UEFI/Platform/Hibernate.cpp b/rEFIt_UEFI/Platform/Hibernate.cpp index 65bff6625..a3e5313f0 100644 --- a/rEFIt_UEFI/Platform/Hibernate.cpp +++ b/rEFIt_UEFI/Platform/Hibernate.cpp @@ -446,13 +446,7 @@ GetSleepImageLocation(IN REFIT_VOLUME *Volume, REFIT_VOLUME **SleepImageVolume, } else { SleepImageName = SWPrintf("%s", prop->getString()->stringValue().c_str()); } - wchar_t* p = SleepImageName.data(0); - while (*p) { - if (*p == L'/') { - *p = L'\\'; - } - p++; - } + SleepImageName.replaceAll('/', '\\'); DBG(" SleepImage name from pref: ImageVolume = '%ls', ImageName = '%ls'\n", ImageVolume->VolName.wc_str(), SleepImageName.wc_str()); } } diff --git a/rEFIt_UEFI/Platform/Nvram.cpp b/rEFIt_UEFI/Platform/Nvram.cpp index 08dc1c46a..4e4ab00af 100755 --- a/rEFIt_UEFI/Platform/Nvram.cpp +++ b/rEFIt_UEFI/Platform/Nvram.cpp @@ -169,7 +169,8 @@ XString8 GetNvramVariableAsXString8( if (DataSize != NULL) { *DataSize = IntDataSize; } - *returnValue.data(IntDataSize) = 0; + returnValue.dataSized(IntDataSize+1)[IntDataSize] = 0; + returnValue.updateSize(); return returnValue; } diff --git a/rEFIt_UEFI/Platform/Self.cpp b/rEFIt_UEFI/Platform/Self.cpp index 71d6bee45..8111d3ba9 100644 --- a/rEFIt_UEFI/Platform/Self.cpp +++ b/rEFIt_UEFI/Platform/Self.cpp @@ -24,7 +24,7 @@ Self self; -constexpr const LStringW THEMES_DIRNAME(L"Themes"); +constexpr const LStringW THEMES_DIRNAME = L"Themes"_XSW; EFI_STATUS Self::_openDir(const XStringW& path, bool* b, EFI_FILE** efiDir) { diff --git a/rEFIt_UEFI/Platform/SelfOem.cpp b/rEFIt_UEFI/Platform/SelfOem.cpp index fed5f12fc..5e7cba395 100644 --- a/rEFIt_UEFI/Platform/SelfOem.cpp +++ b/rEFIt_UEFI/Platform/SelfOem.cpp @@ -22,7 +22,7 @@ #define DBG(...) DebugLog(DEBUG_SELF, __VA_ARGS__) #endif -constexpr const LStringW KEXTS_DIRNAME(L"Kexts"); +constexpr const LStringW KEXTS_DIRNAME = L"Kexts"_XSW; SelfOem selfOem; diff --git a/rEFIt_UEFI/Platform/Settings.cpp b/rEFIt_UEFI/Platform/Settings.cpp index d6d7f8f0a..24d8e47fa 100755 --- a/rEFIt_UEFI/Platform/Settings.cpp +++ b/rEFIt_UEFI/Platform/Settings.cpp @@ -124,7 +124,7 @@ CONST CHAR8* gFirmwareBuildDate = "unknown"; CONST CHAR8* gBuildInfo = NULL; #endif #ifdef BUILD_ID -const LString8 gBuildId __attribute__((used)) = BUILD_ID; +const LString8 gBuildId __attribute__((used)) = LString8(BUILD_ID); const LString8 gBuildIdGrepTag __attribute__((used)) = "CloverBuildIdGrepTag: " BUILD_ID; #else const LString8 gBuildId __attribute__((used)) = "unknown"; @@ -4038,7 +4038,7 @@ static void getACPISettings(const TagDict *CfgDict, SETTINGS_DATA& gSettings) if (Prop3 != NULL && (Prop3->isString()) && Prop3->getString()->stringValue().notEmpty()) { DSDTPatchesLabel = Prop3->getString()->stringValue(); } else { - DSDTPatchesLabel = " (NoLabel)"_XS8; + DSDTPatchesLabel = "(NoLabel)"_XS8; } dsdtPatch.PatchDsdtLabel = DSDTPatchesLabel; DBG(" (%s)", dsdtPatch.PatchDsdtLabel.c_str()); @@ -5139,6 +5139,7 @@ EFI_STATUS GetUserSettings(const TagDict* CfgDict, SETTINGS_DATA& gSettings) if (Prop2 && (Prop2->isString()) && Prop2->getString()->stringValue().notEmpty()) { //first suppose it is Ascii string Property->Value.ncpy(Prop2->getString()->stringValue().c_str(), Prop2->getString()->stringValue().sizeInBytesIncludingTerminator()); + Property->ValueType = kTagTypeString; } else if (Prop2 && (Prop2->isInt64())) { if ( Prop2->getInt64()->intValue() < MIN_INT32 || Prop2->getInt64()->intValue() > MAX_INT32 ) { MsgLog("Invalid int value for key 'Value'\n"); @@ -5707,7 +5708,7 @@ EFI_STATUS GetUserSettings(const TagDict* CfgDict, SETTINGS_DATA& gSettings) StrToGuidLE(Prop2->getString()->stringValue(), &RtVariable.Guid); }else{ StrToGuidLE(nullGuidAsString, &RtVariable.Guid); - DBG("Error: invalid GUID for RT var '%s' - should be in the format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n", Prop->getString()->stringValue().c_str()); + DBG("Error: invalid GUID for RT var '%s' - should be in the format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n", Prop2->getString()->stringValue().c_str()); } } } diff --git a/rEFIt_UEFI/Platform/guid.h b/rEFIt_UEFI/Platform/guid.h index 000057cef..3175c406b 100644 --- a/rEFIt_UEFI/Platform/guid.h +++ b/rEFIt_UEFI/Platform/guid.h @@ -56,7 +56,7 @@ template BOOLEAN IsValidGuidString(const T& Str) { if ( Str.isEmpty() ) return false; - return IsValidGuidString(Str.data(0), Str.length()); + return IsValidGuidString(Str.data(), Str.length()); } ///** Returns TRUE is Str is ascii Guid in format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx */ diff --git a/rEFIt_UEFI/Platform/platformdata.cpp b/rEFIt_UEFI/Platform/platformdata.cpp index 0c4781022..709ede7a3 100644 --- a/rEFIt_UEFI/Platform/platformdata.cpp +++ b/rEFIt_UEFI/Platform/platformdata.cpp @@ -554,10 +554,10 @@ PLATFORMDATA ApplePlatformData[] = { "Xserve3,1"_XS8, "XS31.88Z.0081.B06.0908061300"_XS8, ""_XS8, "Mac-F223BEC8"_XS8, // Intel Xeon E5520 @ 2.26 GHz "Xserve"_XS8, "1.0"_XS8, "CK933YJ16HS"_XS8, "Xserve"_XS8, 0x01, 0x43, 0x0f, 0, 0, 0x04, "NA"_XS8, "NA"_XS8, 0x79001 }, // need rBR RPlt EPCI - //MaxMachineType : empty default value - { ""_XS8, ""_XS8, ""_XS8, ""_XS8, - ""_XS8, ""_XS8, ""_XS8, ""_XS8, - 0x00, 0x00, 0x00, 0, 0, 0x00, ""_XS8, ""_XS8, 0x0 }, + //MaxMachineType : default to iMac132 + { "iMac13,2"_XS8, "IM131.88Z.F000.B00.2004121616"_XS8, "291.0.0.0.0"_XS8, "Mac-FC02E91DDD3FA6A4"_XS8, // Intel Core i5-3470 @ 3.20 GHz + "iMac"_XS8, "1.0"_XS8, "C02JB041DNCW"_XS8, "iMac-Aluminum"_XS8, + 0x02, 0x11, 0x0f, 0, 0, 0x16, "d8"_XS8, "d8"_XS8, 0x79006 }, }; /* diff --git a/rEFIt_UEFI/Platform/platformdata.h b/rEFIt_UEFI/Platform/platformdata.h index e4ea09db5..eccdb5956 100644 --- a/rEFIt_UEFI/Platform/platformdata.h +++ b/rEFIt_UEFI/Platform/platformdata.h @@ -141,12 +141,12 @@ typedef enum { } MACHINE_TYPES; -constexpr LString8 DefaultMemEntry = "N/A"; -constexpr LString8 DefaultSerial = "CT288GT9VT6"; -constexpr LString8 AppleBiosVendor = "Apple Inc."; -constexpr LString8 AppleManufacturer = "Apple Computer, Inc."; //Old name, before 2007 -constexpr LString8 AppleBoardSN = "C02140302D5DMT31M"; -constexpr LString8 AppleBoardLocation = "Part Component"; +constexpr LString8 DefaultMemEntry = "N/A"_XS8; +constexpr LString8 DefaultSerial = "CT288GT9VT6"_XS8; +constexpr LString8 AppleBiosVendor = "Apple Inc."_XS8; +constexpr LString8 AppleManufacturer = "Apple Computer, Inc."_XS8; //Old name, before 2007 +constexpr LString8 AppleBoardSN = "C02140302D5DMT31M"_XS8; +constexpr LString8 AppleBoardLocation = "Part Component"_XS8; class PLATFORMDATA diff --git a/rEFIt_UEFI/Platform/plist/plist.cpp b/rEFIt_UEFI/Platform/plist/plist.cpp index 200760363..47d58edd0 100755 --- a/rEFIt_UEFI/Platform/plist/plist.cpp +++ b/rEFIt_UEFI/Platform/plist/plist.cpp @@ -268,7 +268,7 @@ EFI_STATUS ParseXML(const CHAR8* buffer, TagDict** dict, size_t bufSize) if (tag == NULL) { continue; } - if (tag->isDict()) { + if (tag->isDict()||tag->isArray()) { break; } @@ -280,7 +280,8 @@ EFI_STATUS ParseXML(const CHAR8* buffer, TagDict** dict, size_t bufSize) if (EFI_ERROR(Status)) { return Status; } - *dict = tag->getDict(); + if (tag->isDict()) *dict = tag->getDict(); + else *dict = NULL; return EFI_SUCCESS; } @@ -512,7 +513,7 @@ EFI_STATUS ParseTagKey( char * buffer, TagStruct** tag, UINT32* lenPtr) // return Status; // } tmpTag = TagKey::getEmptyTag(); - tmpTag->setKeyValue(LString8(buffer)); + tmpTag->setKeyValue(LString8(buffer, strlen(buffer))); *tag = tmpTag; *lenPtr = length + length2; @@ -539,7 +540,8 @@ EFI_STATUS ParseTagString(CHAR8* buffer, TagStruct* * tag,UINT32* lenPtr) return EFI_OUT_OF_RESOURCES; } - tmpTag->setStringValue(LString8(XMLDecode(buffer))); + size_t outlen = XMLDecode(buffer, strlen(buffer), buffer, strlen(buffer)); + tmpTag->setStringValue(LString8(buffer, outlen)); *tag = tmpTag; *lenPtr = length; DBG(" parse string %s\n", tmpTag->getString()->stringValue().c_str()); @@ -697,7 +699,7 @@ EFI_STATUS ParseTagDate(CHAR8* buffer, TagStruct* * tag,UINT32* lenPtr) tmpTag = TagDate::getEmptyTag(); - tmpTag->setDateValue(LString8(buffer)); + tmpTag->setDateValue(LString8(buffer, length)); *tag = tmpTag; *lenPtr = length; diff --git a/rEFIt_UEFI/Platform/plist/xml.cpp b/rEFIt_UEFI/Platform/plist/xml.cpp index 87033e4dd..2dbdcabf8 100755 --- a/rEFIt_UEFI/Platform/plist/xml.cpp +++ b/rEFIt_UEFI/Platform/plist/xml.cpp @@ -107,6 +107,12 @@ size_t XMLDecode(const char* src, size_t srclen, char* out, size_t outlen) return uintptr_t(o)-uintptr_t(out); } +char* XMLDecode(char* src, size_t size) +{ + XMLDecode(src, size, src, size+1); + return src; +} + char* XMLDecode(char* src) { XMLDecode(src, strlen(src), src, strlen(src)+1); diff --git a/rEFIt_UEFI/Platform/smbios.cpp b/rEFIt_UEFI/Platform/smbios.cpp index 2280325b0..d58cedc99 100644 --- a/rEFIt_UEFI/Platform/smbios.cpp +++ b/rEFIt_UEFI/Platform/smbios.cpp @@ -50,7 +50,7 @@ EFI_GUID *gTableGuidArray[] = {&gEfiSmbiosTableGuid, &gEfiSmbios3TableGuid}; -constexpr LString8 unknown("unknown"); +constexpr LString8 unknown = "unknown"_XS8; // // syscl: implement Dell truncate fix // remap EFI_SMBIOS_TABLE_1 to new guid to fix Dell diff --git a/rEFIt_UEFI/PlatformEFI/posix/posix.h b/rEFIt_UEFI/PlatformEFI/posix/posix.h index c83ab8c12..390bd04f6 100755 --- a/rEFIt_UEFI/PlatformEFI/posix/posix.h +++ b/rEFIt_UEFI/PlatformEFI/posix/posix.h @@ -38,7 +38,6 @@ void abort(void); -size_t strlen(const char *str); inline float fabsf(float x) { diff --git a/rEFIt_UEFI/PlatformEFI/posix/string.h b/rEFIt_UEFI/PlatformEFI/posix/string.h index a7190f304..c768c4630 100644 --- a/rEFIt_UEFI/PlatformEFI/posix/string.h +++ b/rEFIt_UEFI/PlatformEFI/posix/string.h @@ -29,6 +29,8 @@ void* memcpy(void *dst, const void *src, size_t len); // return CopyMem(dst,src,len); //} +size_t strlen(const char *str); + inline char* strcat(char* s1, const char* s2) { AsciiStrCatS(s1, AsciiStrLen(s1)+1, s2); diff --git a/rEFIt_UEFI/PlatformEFI/posix/strlen.cpp b/rEFIt_UEFI/PlatformEFI/posix/strlen.cpp index 3fad5874c..c672029e0 100755 --- a/rEFIt_UEFI/PlatformEFI/posix/strlen.cpp +++ b/rEFIt_UEFI/PlatformEFI/posix/strlen.cpp @@ -4,6 +4,7 @@ #include // for abort #include // for size_t #include // for SIZE_T_MAX +#include // for strlen definition #ifdef MAP_TO_EDK_STRLEN extern "C" UINTN EFIAPI AsciiStrLen(IN CONST CHAR8 *String); diff --git a/rEFIt_UEFI/PlatformPOSIX/BootLog.cpp b/rEFIt_UEFI/PlatformPOSIX/BootLog.cpp index bdde985d1..f1de9a472 100644 --- a/rEFIt_UEFI/PlatformPOSIX/BootLog.cpp +++ b/rEFIt_UEFI/PlatformPOSIX/BootLog.cpp @@ -52,7 +52,7 @@ PrintBytes(IN void *Bytes, IN UINTN Number) } } -bool disabledLog = false; +bool gEnableCloverLog = false; // Changed MsgLog(...) it now calls this function // with DebugMode == 0. - apianti @@ -61,7 +61,7 @@ bool disabledLog = false; // DebugMode==2 Prints to msg log, DEBUG_LOG and display console void EFIAPI DebugLog(IN INTN DebugMode, IN CONST CHAR8 *FormatString, ...) { - if ( disabledLog ) return; + if ( !gEnableCloverLog ) return; VA_LIST Marker; // Make sure the buffer is intact for writing diff --git a/rEFIt_UEFI/PlatformPOSIX/include/Platform.h b/rEFIt_UEFI/PlatformPOSIX/include/Platform.h index 844e664d1..fcc51aae9 100644 --- a/rEFIt_UEFI/PlatformPOSIX/include/Platform.h +++ b/rEFIt_UEFI/PlatformPOSIX/include/Platform.h @@ -9,7 +9,9 @@ #ifndef Platform_h_h #define Platform_h_h -#define _UINTPTR_T +#ifndef _UINTPTR_T +#define _UINTPTR_T // to prevent macOS definition of uintptr_t (map to a long). We prefer long long so we can use %llu on all platform (including microsoft) +#endif #ifdef _MSC_VER #include diff --git a/rEFIt_UEFI/PlatformPOSIX/include/XToolsConf.h b/rEFIt_UEFI/PlatformPOSIX/include/XToolsConf.h index 99f966868..18e2dbfdf 100755 --- a/rEFIt_UEFI/PlatformPOSIX/include/XToolsConf.h +++ b/rEFIt_UEFI/PlatformPOSIX/include/XToolsConf.h @@ -12,8 +12,8 @@ #endif //#define MAX_XISIZE MAX_INTN -#define XStringGrowByDefault 10 -#define XArrayGrowByDefault 8 +#define XStringGrowByDefault 16 +#define XArrayGrowByDefault 16 #define XBufferGrowByDefault 16 /* For convience, operator [] is define with int parameter. diff --git a/rEFIt_UEFI/PlatformPOSIX/posix/clover_strlen.cpp b/rEFIt_UEFI/PlatformPOSIX/posix/clover_strlen.cpp new file mode 100755 index 000000000..16b131362 --- /dev/null +++ b/rEFIt_UEFI/PlatformPOSIX/posix/clover_strlen.cpp @@ -0,0 +1,99 @@ + +//#include // use angled, so posix.h will vary depending of the platform + +#include // for abort +#include // for size_t +#include // for SIZE_T_MAX +#include // for strlen definition + +#ifdef MAP_TO_EDK_STRLEN +extern "C" UINTN EFIAPI AsciiStrLen(IN CONST CHAR8 *String); +#endif + +// Hope that unsigned long long is as big in bits sa a pointer difference. + +#define DOWN_CAST_TO_SIZE_T(a) ( (uintptr_t)(a) > (uintptr_t)(SIZE_T_MAX) ? abort(), 0 : (size_t)(a) ) + +/* Return the length of the null-terminated string STR. Scan for + the null terminator quickly by testing four bytes at a time. */ +size_t clover_strlen(const char *str) +{ +#ifdef MAP_TO_EDK_STRLEN + return (size_t)(AsciiStrLen(str)); +#endif + + const char *char_ptr; + const unsigned long int *longword_ptr; + unsigned long int longword, himagic, lomagic; + + /* Handle the first few characters by reading one character at a time. + Do this until CHAR_PTR is aligned on a longword boundary. */ + for (char_ptr = str; ((uintptr_t) char_ptr + & (sizeof (longword) - 1)) != 0; + ++char_ptr) + if (*char_ptr == '\0') { + return DOWN_CAST_TO_SIZE_T(char_ptr - str); + } + + /* All these elucidatory comments refer to 4-byte longwords, + but the theory applies equally well to 8-byte longwords. */ + + longword_ptr = (unsigned long int *) char_ptr; + + /* Bits 31, 24, 16, and 8 of this number are zero. Call these bits + the "holes." Note that there is a hole just to the left of + each byte, with an extra at the end: + + bits: 01111110 11111110 11111110 11111111 + bytes: AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD + + The 1-bits make sure that carries propagate to the next 0-bit. + The 0-bits provide holes for carries to fall into. */ + himagic = 0x80808080L; + lomagic = 0x01010101L; + if (sizeof (longword) > 4) + { + /* 64-bit version of the magic. */ + /* Do the shift in two steps to avoid a warning if long has 32 bits. */ + himagic = ((himagic << 16) << 16) | himagic; + lomagic = ((lomagic << 16) << 16) | lomagic; + } + if (sizeof (longword) > 8) + abort (); + + /* Instead of the traditional loop which tests each character, + we will test a longword at a time. The tricky part is testing + if *any of the four* bytes in the longword in question are zero. */ + for (;;) + { + longword = *longword_ptr++; + + if (((longword - lomagic) & ~longword & himagic) != 0) + { + /* Which of the bytes was the zero? If none of them were, it was + a misfire; continue the search. */ + + const char *cp = (const char *) (longword_ptr - 1); + + if (cp[0] == 0) + return DOWN_CAST_TO_SIZE_T(cp - str); + if (cp[1] == 0) + return DOWN_CAST_TO_SIZE_T(cp - str + 1); + if (cp[2] == 0) + return DOWN_CAST_TO_SIZE_T(cp - str + 2); + if (cp[3] == 0) + return DOWN_CAST_TO_SIZE_T(cp - str + 3); + if (sizeof (longword) > 4) + { + if (cp[4] == 0) + return DOWN_CAST_TO_SIZE_T(cp - str + 4); + if (cp[5] == 0) + return DOWN_CAST_TO_SIZE_T(cp - str + 5); + if (cp[6] == 0) + return DOWN_CAST_TO_SIZE_T(cp - str + 6); + if (cp[7] == 0) + return DOWN_CAST_TO_SIZE_T(cp - str + 7); + } + } + } +} diff --git a/rEFIt_UEFI/PlatformPOSIX/posix/posix_additions.cpp b/rEFIt_UEFI/PlatformPOSIX/posix/posix_additions.cpp index 65059e68c..f823a93c7 100644 --- a/rEFIt_UEFI/PlatformPOSIX/posix/posix_additions.cpp +++ b/rEFIt_UEFI/PlatformPOSIX/posix/posix_additions.cpp @@ -32,7 +32,7 @@ extern "C" { XString8 stdio_static_buf = XString8().takeValueFrom("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX "); // prealloc stdio_static_buf. It has to be at least 2 chars because of 'while ( n > size - 2 )' in strguid and efiStrError -static char efiStrError_buf[40]; +static char efiStrError_buf[90]; const char* efiStrError(EFI_STATUS Status) { if ( !EFI_ERROR(Status) ) { diff --git a/rEFIt_UEFI/PlatformPOSIX/posix/posix_additions.h b/rEFIt_UEFI/PlatformPOSIX/posix/posix_additions.h index 79347cb43..20b2e2db1 100644 --- a/rEFIt_UEFI/PlatformPOSIX/posix/posix_additions.h +++ b/rEFIt_UEFI/PlatformPOSIX/posix/posix_additions.h @@ -13,4 +13,6 @@ const char* strguid(EFI_GUID* guid); //int snwprintf(wchar_t*, size_t len, const char *__restrict format, ...) __attribute__((__format__ (__printf__, 3, 4))); +size_t clover_strlen(const char *str); + #endif /* PLATFORM_POSIX_POSIX_ADDITIONS_H_ */ diff --git a/rEFIt_UEFI/cpp_foundation/XString.h b/rEFIt_UEFI/cpp_foundation/XString.h index 4c8dde3a3..d699754ab 100755 --- a/rEFIt_UEFI/cpp_foundation/XString.h +++ b/rEFIt_UEFI/cpp_foundation/XString.h @@ -27,13 +27,19 @@ class LString8 : public LString { public: constexpr LString8() = delete; - constexpr LString8(const char* s) : LString(s) {}; + #ifdef XSTRING_CACHING_OF_SIZE + LString8(const char* s) : LString(s, utf8_size_of_utf8_string(s)) {}; + constexpr LString8(const char* s, size_t size) : LString(s, size) {}; + #else + constexpr LString8(const char* s) : LString(s) {}; + constexpr LString8(const char* s, size_t size) : LString(s) {}; + #endif // no assignement, no destructor - friend constexpr LString8 operator "" _XS8 ( const char* s, size_t) { return LString8(s); } + friend constexpr LString8 operator "" _XS8 ( const char* s, size_t size) { return LString8(s, size); } - const char* c_str() const { return m_data; } + const char* c_str() const { return data(); } }; @@ -51,7 +57,7 @@ class XString8 : public XStringAbstract using XStringAbstract::operator =; - const char* c_str() const { return m_data; } + const char* c_str() const { return data(); } // char* copy_str() const { return (char*)AllocateCopyPool(length()+1, m_data); } protected: @@ -92,9 +98,13 @@ public: class XString16; class LString16 : public LString { - constexpr LString16(const char16_t* s) : LString(s) {}; + #ifdef XSTRING_CACHING_OF_SIZE + constexpr LString16(const char16_t* s, size_t size) : LString(s, size) {}; + #else + constexpr LString16(const char16_t* s, size_t size) : LString(s) {}; + #endif - friend constexpr LString16 operator "" _XS16 ( const char16_t* s, size_t) { return LString16(s); } + friend constexpr LString16 operator "" _XS16 ( const char16_t* s, size_t size) { return LString16(s, size); } }; class XString16 : public XStringAbstract @@ -119,9 +129,13 @@ class XString16 : public XStringAbstract class XString32; class LString32 : public LString { - constexpr LString32(const char32_t* s) : LString(s) {}; + #ifdef XSTRING_CACHING_OF_SIZE + constexpr LString32(const char32_t* s, size_t size) : LString(s, size) {}; + #else + constexpr LString32(const char32_t* s, size_t size) : LString(s) {}; + #endif - friend constexpr LString32 operator "" _XS32 ( const char32_t* s, size_t) { return LString32(s); } + friend constexpr LString32 operator "" _XS32 ( const char32_t* s, size_t size) { return LString32(s, size); } }; class XString32 : public XStringAbstract @@ -147,11 +161,18 @@ class LStringW : public LString { public: constexpr LStringW() = delete; - constexpr LStringW(const wchar_t* s) : LString(s) {}; - - friend constexpr LStringW operator "" _XSW ( const wchar_t* s, size_t) { return LStringW(s); } + + #ifdef XSTRING_CACHING_OF_SIZE + LStringW(const wchar_t* s) : LString(s, wchar_size_of_wchar_string(s)) {}; + constexpr LStringW(const wchar_t* s, size_t size) : LString(s, size) {}; + #else + constexpr LStringW(const wchar_t* s) : LString(s) {}; + constexpr LStringW(const wchar_t* s, size_t size) : LString(s) {}; + #endif - const wchar_t* wc_str() const { return m_data; } + friend constexpr LStringW operator "" _XSW ( const wchar_t* s, size_t size) { return LStringW(s, size); } + + const wchar_t* wc_str() const { return data(); } }; class XStringW : public XStringAbstract @@ -169,7 +190,7 @@ public: using XStringAbstract::operator =; - const wchar_t* wc_str() const { return m_data; } + const wchar_t* wc_str() const { return data(); } template const wchar_t* wc_str(IntegralType idx) const { return data(idx); } diff --git a/rEFIt_UEFI/cpp_foundation/XStringAbstract.h b/rEFIt_UEFI/cpp_foundation/XStringAbstract.h index 3078239f0..0a83c1e3b 100755 --- a/rEFIt_UEFI/cpp_foundation/XStringAbstract.h +++ b/rEFIt_UEFI/cpp_foundation/XStringAbstract.h @@ -42,13 +42,7 @@ #define DBG_XSTRING(...) DebugLog(DEBUG_XStringAbstract, __VA_ARGS__) #endif -//#if __WCHAR_MAX__ <= 0xFFFFu -// #define wchar_cast char16_t -//#else -// #define wchar_cast char32_t -//#endif - - +//#define XSTRING_CACHING_OF_SIZE #define asciiToLower(ch) (((ch >= L'A') && (ch <= L'Z')) ? ((ch - L'A') + L'a') : ch) #define asciiToUpper(ch) (((ch >= L'a') && (ch <= L'z')) ? ((ch - L'a') + L'A') : ch) @@ -232,57 +226,84 @@ public: typedef T char_t; typedef ThisXStringClass xs_t; protected: - T *m_data; - + T *__m_data; +protected: + #ifdef XSTRING_CACHING_OF_SIZE + size_t __m_size; + #endif + // convenience method. Did it this way to avoid #define in header. They can have an impact on other headers size_t Xmin(size_t x1, size_t x2) const { if ( x1 < x2 ) return x1; return x2; } size_t Xmax(size_t x1, size_t x2) const { if ( x1 > x2 ) return x1; return x2; } + + #ifdef XSTRING_CACHING_OF_SIZE + #if 1 // if 1, the size will be checked. For debug purpose. + void checkSizeCached() const { // Debug method + if ( size_of_utf_string(__m_data) != __m_size ) { + panic("bug XString"); + } + } + #define XSTRING_CHECK_SIZE __String::checkSizeCached() + #else + #define XSTRING_CHECK_SIZE + #endif + #else + #define XSTRING_CHECK_SIZE + #endif + // Method _data is protected intentionally. It's a const method returning non-const pointer. That's intentional, but dangerous. Do not expose to public. // If you need a non-const pointer for low-level access, use dataSized and specify the size // pos is counted in logical char (UTF32 char) template T* _data(IntegralType pos) const { -#ifdef DEBUG - if ( pos<0 ) panic("T* data(int i) -> i < 0"); -#else - if ( pos<0 ) return 0; -#endif - - size_t offset = size_of_utf_string_len(m_data, (unsigned_type(IntegralType))pos); // If pos is too big, size_of_utf_string_len returns the end of the string - return m_data + offset; + XSTRING_CHECK_SIZE; + if ( pos<0 ) { + panic_ask("T* data(int i) -> i < 0"); + return __m_data; + } + size_t offset = size_of_utf_string_len(__m_data, (unsigned_type(IntegralType))pos); // If pos is too big, size_of_utf_string_len returns the end of the string + return __m_data + offset; } -public: -// T* memoryOffset(size_t i) { -// -// } -public: - constexpr __String(const T* s) : m_data((T*)s) {} public: + #ifdef XSTRING_CACHING_OF_SIZE + constexpr __String(const T* s, size_t size) : __m_data((T*)s), __m_size(size) { } // Do NOT call with size != strlen(s). This is for litteral operator, not for public usage. + #else + constexpr __String(const T* s) : __m_data((T*)s) {} + #endif + // constexpr __String() : m_data(&nullChar) { } constexpr __String(const __String&) = delete; constexpr __String() = delete; // no assignement, no destructor - size_t length() const { return length_of_utf_string(m_data); } -// size_t sizeZZ() const { return size_of_utf_string(m_data); } - size_t sizeInNativeChars() const { return size_of_utf_string(m_data); } - size_t sizeInBytes() const { return size_of_utf_string(m_data)*sizeof(T); } - size_t sizeInBytesIncludingTerminator() const { return (size_of_utf_string(m_data)+1)*sizeof(T); } // usefull for unit tests - - - const T* s() const { return m_data; } - - const T* data() const { return m_data; } + const T* s() const { XSTRING_CHECK_SIZE; return __m_data; } + const T* data() const { XSTRING_CHECK_SIZE; return __m_data; } template - const T* data(IntegralType pos) const { return __String::_data(pos); } + const T* data(IntegralType pos) const { return _data(pos); } + + + size_t length() const { return length_of_utf_string(data()); } // TODO: caching length + + #ifdef XSTRING_CACHING_OF_SIZE + size_t size() const { XSTRING_CHECK_SIZE; return __m_size; } + size_t sizeInNativeChars() const { return size(); } + size_t sizeInBytes() const { return size()*sizeof(T); } + size_t sizeInBytesIncludingTerminator() const { return (size()+1)*sizeof(T); } // usefull for unit tests + #else + size_t size() const { XSTRING_CHECK_SIZE; return size_of_utf_string(data()); } + size_t sizeInNativeChars() const { return size_of_utf_string(data()); } + size_t sizeInBytes() const { return size_of_utf_string(data())*sizeof(T); } + size_t sizeInBytesIncludingTerminator() const { return (size_of_utf_string(data())+1)*sizeof(T); } // usefull for unit tests + #endif + /* Empty ? */ - bool isEmpty() const { return m_data == nullptr || *m_data == 0; } + bool isEmpty() const { return data() == nullptr || *data() == 0; } bool notEmpty() const { return !isEmpty(); } @@ -305,7 +326,7 @@ public: #endif } size_t nb = 0; - const T *p = m_data; + const T *p = data(); char32_t char32; do { p = get_char32_from_string(p, &char32); @@ -358,20 +379,20 @@ public: size_t indexOf(char32_t char32Searched, size_t Pos = 0) const { char32_t buf[2] = { char32Searched, 0}; - return XStringAbstract__indexOf(m_data, Pos, buf, false); + return XStringAbstract__indexOf(data(), Pos, buf, false); } template - size_t indexOf(const O* S, size_t Pos = 0) const { return XStringAbstract__indexOf(m_data, Pos, S, false); } + size_t indexOf(const O* S, size_t Pos = 0) const { return XStringAbstract__indexOf(data(), Pos, S, false); } template size_t indexOf(const __String& S, size_t Pos = 0) const { return indexOf(S.s(), Pos); } /* IC */ size_t indexOfIC(char32_t char32Searched, size_t Pos = 0) const { char32_t buf[2] = { char32Searched, 0}; - return XStringAbstract__indexOf(m_data, Pos, buf, true); + return XStringAbstract__indexOf(data(), Pos, buf, true); } template - size_t indexOfIC(const O* S, size_t Pos = 0) const { return XStringAbstract__indexOf(m_data, Pos, S, true); } + size_t indexOfIC(const O* S, size_t Pos = 0) const { return XStringAbstract__indexOf(data(), Pos, S, true); } template size_t indexOfIC(const __String& S, size_t Pos = 0) const { return indexOfIC(S.s(), Pos); } @@ -380,20 +401,20 @@ public: size_t rindexOf(const char32_t char32Searched, size_t Pos = MAX_XSIZE-1) const { char32_t buf[2] = { char32Searched, 0}; - return XStringAbstract__rindexOf(m_data, Pos, buf, false); + return XStringAbstract__rindexOf(data(), Pos, buf, false); } template - size_t rindexOf(const O* S, size_t Pos = MAX_XSIZE-1) const { return XStringAbstract__rindexOf(m_data, Pos, S, false); } + size_t rindexOf(const O* S, size_t Pos = MAX_XSIZE-1) const { return XStringAbstract__rindexOf(data(), Pos, S, false); } template size_t rindexOf(const __String& S, size_t Pos = MAX_XSIZE-1) const { return rindexOf(S.s(), Pos); } /* IC */ size_t rindexOfIC(const char32_t char32Searched, size_t Pos = MAX_XSIZE-1) const { char32_t buf[2] = { char32Searched, 0}; - return XStringAbstract__rindexOf(m_data, Pos, buf, true); + return XStringAbstract__rindexOf(data(), Pos, buf, true); } template - size_t rindexOfIC(const O* S, size_t Pos = MAX_XSIZE-1) const { return XStringAbstract__rindexOf(m_data, Pos, S, true); } + size_t rindexOfIC(const O* S, size_t Pos = MAX_XSIZE-1) const { return XStringAbstract__rindexOf(data(), Pos, S, true); } template size_t rindexOfIC(const __String& S, size_t Pos = MAX_XSIZE-1) const { return rindexOf(S.s(), Pos); } @@ -414,7 +435,7 @@ public: ThisXStringClass ret; - const T* src = m_data; + const T* src = data(); char32_t char32 = 1; while ( char32 && pos > 0 ) { src = get_char32_from_string(src, &char32); @@ -427,33 +448,33 @@ public: template bool startWith(O otherChar) const { O other[2] = { otherChar, 0}; - return XStringAbstract__startWith(m_data, other, false); + return XStringAbstract__startWith(data(), other, false); } template - bool startWith(const __String& otherS) const { return XStringAbstract__startWith(m_data, otherS.m_data, false); } + bool startWith(const __String& otherS) const { return XStringAbstract__startWith(data(), otherS.data(), false); } template - bool startWith(const O* other) const { return XStringAbstract__startWith(m_data, other, false); } + bool startWith(const O* other) const { return XStringAbstract__startWith(data(), other, false); } template - bool startWithIC(const __String& otherS) const { return XStringAbstract__startWith(m_data, otherS.m_data, true); } + bool startWithIC(const __String& otherS) const { return XStringAbstract__startWith(data(), otherS.data(), true); } template - bool startWithIC(const O* other) const { return XStringAbstract__startWith(m_data, other, true); } + bool startWithIC(const O* other) const { return XStringAbstract__startWith(data(), other, true); } template bool startWithOrEqualTo(O otherChar) const { O other[2] = { otherChar, 0}; - return XStringAbstract__startWithOrEqualTo(m_data, other, false); + return XStringAbstract__startWithOrEqualTo(data(), other, false); } template - bool startWithOrEqualTo(const __String& otherS) const { return XStringAbstract__startWithOrEqualTo(m_data, otherS.m_data, false); } + bool startWithOrEqualTo(const __String& otherS) const { return XStringAbstract__startWithOrEqualTo(data(), otherS.data(), false); } template - bool startWithOrEqualTo(const O* other) const { return XStringAbstract__startWithOrEqualTo(m_data, other, false); } + bool startWithOrEqualTo(const O* other) const { return XStringAbstract__startWithOrEqualTo(data(), other, false); } template - bool startWithOrEqualToIC(const __String& otherS) const { return XStringAbstract__startWithOrEqualTo(m_data, otherS.m_data, true); } + bool startWithOrEqualToIC(const __String& otherS) const { return XStringAbstract__startWithOrEqualTo(data(), otherS.data(), true); } template - bool startWithOrEqualToIC(const O* other) const { return XStringAbstract__startWithOrEqualTo(m_data, other, true); } + bool startWithOrEqualToIC(const O* other) const { return XStringAbstract__startWithOrEqualTo(data(), other, true); } template - bool endWithOrEqualToIC(const __String& otherS) const { if ( length() < otherS.length() ) return false; return XStringAbstract__rindexOf(m_data, SIZE_T_MAX-1, otherS.data(), true) == length() - otherS.length(); } + bool endWithOrEqualToIC(const __String& otherS) const { if ( length() < otherS.length() ) return false; return XStringAbstract__rindexOf(data(), SIZE_T_MAX-1, otherS.data(), true) == length() - otherS.length(); } //--------------------------------------------------------------------- @@ -461,7 +482,7 @@ public: { size_t lastSepPos = MAX_XSIZE; size_t pos = 0; - const T *p = m_data; + const T *p = data(); char32_t char32; p = get_char32_from_string(p, &char32); while ( char32 ) { @@ -470,7 +491,7 @@ public: p = get_char32_from_string(p, &char32); }; if ( lastSepPos == MAX_XSIZE ) { - if ( p == m_data ) return ThisXStringClass().takeValueFrom("."); + if ( p == data() ) return ThisXStringClass().takeValueFrom("."); } return subString(lastSepPos+1, MAX_XSIZE); } @@ -507,25 +528,25 @@ public: //--------------------------------------------------------------------- strcmp, equal, comparison operator template - int strcmp(const O* S) const { return XStringAbstract__compare(m_data, S, false); } -// int Compare(const char* S) const { return ::Compare(m_data, S); } -// int Compare(const char16_t* S) const { return ::Compare(m_data, S); }; -// int Compare(const char32_t* S) const { return ::Compare(m_data, S); }; -// int Compare(const wchar_t* S) const { return ::Compare(m_data, S); }; + int strcmp(const O* S) const { return XStringAbstract__compare(data(), S, false); } +// int Compare(const char* S) const { return ::Compare(data(), S); } +// int Compare(const char16_t* S) const { return ::Compare(data(), S); }; +// int Compare(const char32_t* S) const { return ::Compare(data(), S); }; +// int Compare(const wchar_t* S) const { return ::Compare(data(), S); }; // template - int strncmp(const O* S, size_t n) const { return XStringAbstract__ncompare(m_data, S, n, false); } + int strncmp(const O* S, size_t n) const { return XStringAbstract__ncompare(data(), S, n, false); } template - bool equal(const __String& S) const { return XStringAbstract__compare(m_data, S.s(), false) == 0; } + bool equal(const __String& S) const { return XStringAbstract__compare(data(), S.s(), false) == 0; } template - bool equal(const O* S) const { return XStringAbstract__compare(m_data, S, false) == 0; } + bool equal(const O* S) const { return XStringAbstract__compare(data(), S, false) == 0; } template - bool equalIC(const __String& S) const { return XStringAbstract__compare(m_data, S.s(), true) == 0; } + bool equalIC(const __String& S) const { return XStringAbstract__compare(data(), S.s(), true) == 0; } template - bool equalIC(const O* S) const { return XStringAbstract__compare(m_data, S, true) == 0; } + bool equalIC(const O* S) const { return XStringAbstract__compare(data(), S, true) == 0; } // bool SubStringEqual(size_t Pos, const T* S) const { return (memcmp(data(Pos), S, wcslen(S)) == 0); } @@ -540,7 +561,7 @@ public: #endif if ( (unsigned_type(IntegralType))pos > length() - S.length() ) return false; - return XStringAbstract__ncompare(m_data + (unsigned_type(IntegralType))pos, S.s(), S.length(), true) == 0; + return XStringAbstract__ncompare(data() + (unsigned_type(IntegralType))pos, S.s(), S.length(), true) == 0; } public: @@ -597,9 +618,16 @@ class LString : public __String { public: protected: +#ifdef XSTRING_CACHING_OF_SIZE + constexpr LString(const T* s) : __String(s, 0) {}; + constexpr LString(const T* s, size_t size) : __String(s, size) {}; + constexpr LString(const LString& L) : __String(L.data(), L.size()) {}; +#else constexpr LString(const T* s) : __String(s) {}; + constexpr LString(const LString& L) : __String(L.data()) {}; +#endif + constexpr LString() = delete; - constexpr LString(const LString& L) : __String(L.m_data) {}; // no assignement, no destructor @@ -724,11 +752,12 @@ struct _xstringarray__char_type //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -#define m_data __String::m_data +//#define data() super::data() template class XStringAbstract : public __String { + using super = __String; static T nullChar; protected: @@ -741,84 +770,89 @@ class XStringAbstract : public __String /* * nNewSize must include null terminator. */ - void Alloc(size_t nNewSize) + void Alloc(size_t nNewAllocatedSize) { if ( m_allocatedSize == 0 ) { - m_data = (T*)malloc( nNewSize*sizeof(T) ); + super::__m_data = (T*)malloc( nNewAllocatedSize*sizeof(T) ); } else { - m_data = (T*)Xrealloc(m_data, nNewSize*sizeof(T), m_allocatedSize*sizeof(T)); + super::__m_data = (T*)Xrealloc(super::__m_data, nNewAllocatedSize*sizeof(T), m_allocatedSize*sizeof(T)); } - if ( !m_data ) { - -#ifdef DEBUG - panic("XStringAbstract::Alloc(%zu) : Xrealloc(%" PRIuPTR ", %lu, %zd) returned NULL. System halted\n", nNewSize, uintptr_t(m_data), nNewSize*sizeof(T), m_allocatedSize*sizeof(T)); -#else + if ( !super::__m_data ) { + panic_ask("XStringAbstract::Alloc(%zu) : Xrealloc(%" PRIuPTR ", %lu, %zd) returned NULL. System halted\n", nNewAllocatedSize, uintptr_t(super::__m_data), nNewAllocatedSize*sizeof(T), m_allocatedSize*sizeof(T)); m_allocatedSize = 0; return; -#endif } - m_allocatedSize = nNewSize; + m_allocatedSize = nNewAllocatedSize; } // public: /* * Make sure this string has allocated size of at least nNewSize+1. */ - bool CheckSize(size_t nNewSize, size_t nGrowBy = XStringGrowByDefault) // nNewSize is in number of chars, NOT bytes + bool CheckSize(size_t nNewAllocatedSize, size_t nGrowBy = XStringGrowByDefault) // nNewSize is in number of chars, NOT bytes { //DBG_XSTRING("CheckSize: m_size=%d, nNewSize=%d\n", m_size, nNewSize); - if ( m_allocatedSize < nNewSize+1 ) + if ( m_allocatedSize < nNewAllocatedSize+1 ) { - nNewSize += nGrowBy; - if ( m_allocatedSize == 0 ) { //if ( *m_data ) { - size_t len = __String::length(); - if ( nNewSize < len ) nNewSize = len; - T* m_dataSav = m_data; - m_data = NULL; - Alloc(nNewSize+1); - utf_string_from_utf_string(m_data, m_allocatedSize, m_dataSav); + nNewAllocatedSize += nGrowBy; + if ( m_allocatedSize == 0 ) { //if ( *data() ) { + // Even if m_allocatedSize == 0, data() might not be NULL because it can points to a litteral. + // So we need to alloc and cpy the litteral in the newly allocated buffer. + size_t size = super::size(); + if ( nNewAllocatedSize < size ) nNewAllocatedSize = size; + const T* m_dataSav = super::data(); + //super::__m_data = NULL; // No need, Alloc will reassign it. + Alloc(nNewAllocatedSize+1); + utf_string_from_utf_string(super::__m_data, m_allocatedSize, m_dataSav); return true; }else{ - Alloc(nNewSize+1); + Alloc(nNewAllocatedSize+1); return true; } } return false; } -// void setSize(size_t newSize) // nNewSize is in number of chars, NOT bytes -// { -// //DBG_XSTRING("setLength(%d)\n", len); -// CheckSize(newSize); -// // if ( len >= size() ) { -// // DBG_XSTRING("__String::setLength(size_t len) : len >= size() (%d != %d). System halted\n", len, size()); -// // panic(); -// // } -// m_data[newSize] = 0; // we may rewrite a 0 in nullChar, if no memory were allocated. That's ok. -// } - public: /* default ctor */ +#ifdef XSTRING_CACHING_OF_SIZE + XStringAbstract() : __String(&nullChar, 0), m_allocatedSize(0) {} +#else XStringAbstract() : __String(&nullChar), m_allocatedSize(0) {} +#endif /* copy ctor */ +#ifdef XSTRING_CACHING_OF_SIZE + XStringAbstract(const XStringAbstract& S) : __String(&nullChar, 0), m_allocatedSize(0) +#else XStringAbstract(const XStringAbstract& S) : __String(&nullChar), m_allocatedSize(0) +#endif { - if ( S.m_data && !S.m_allocatedSize ) { - m_data = S.m_data; - }else{ - takeValueFrom(S); - } + *this = S; } ~XStringAbstract() { //DBG_XSTRING("Destructor :%ls\n", data()); - if ( m_allocatedSize > 0 ) free((void*)m_data); + if ( m_allocatedSize > 0 ) free((void*)super::__m_data); } +#ifdef XSTRING_CACHING_OF_SIZE + /* ctor */ + template + explicit XStringAbstract(const LString& S) : __String(S.s(), S.size()), m_allocatedSize(0) {} + + template + explicit XStringAbstract(const XStringAbstract& S) : __String(&nullChar, 0), m_allocatedSize(0) { takeValueFrom(S); } + template + explicit XStringAbstract(const LString& S) : __String(&nullChar), m_allocatedSize(0) { takeValueFrom(S); } +// TEMPORARILY DISABLED +// template +// explicit __String(const O* S) { Init(0); takeValueFrom(S); } +// +#else /* ctor */ template explicit XStringAbstract(const LString& S) : __String(S.s()), m_allocatedSize(0) {} @@ -831,8 +865,25 @@ public: // template // explicit __String(const O* S) { Init(0); takeValueFrom(S); } // - /* Copy Assign */ // Only other XString, no litteral at the moment. - XStringAbstract& operator=(const XStringAbstract &S) { takeValueFrom(S); return *this; } +#endif + /* Copy Assign */ + XStringAbstract& operator=(const XStringAbstract &S) { + if ( S.data() && S.m_allocatedSize == 0 ) { + // S points to a litteral + if ( m_allocatedSize > 0 ) { + delete super::__m_data; + m_allocatedSize = 0; + } + super::__m_data = (T*)S.data(); // because it's a litteral, we don't copy. We need to cast, but we won't modify. + #ifdef XSTRING_CACHING_OF_SIZE + super::__m_size = S.size(); + #endif + }else{ + strsicpy(S.s(), S.size()); + } + return *this; + } + /* Assign */ #ifndef _MSC_VER #pragma GCC diagnostic push @@ -843,22 +894,23 @@ public: #ifndef _MSC_VER #pragma GCC diagnostic pop #endif + // TEMPORARILY DISABLED // template // ThisXStringClass& operator =(const O* S) { strcpy(S); return *this; } protected: - ThisXStringClass& takeValueFromLiteral(const T* s) - { -#ifdef DEBUG - if ( m_allocatedSize > 0 ) panic("XStringAbstract::takeValueFromLiteral -> m_allocatedSize > 0"); -#else - if ( m_allocatedSize < 0 ) return 0; -#endif - - m_data = (T*)s; - return *((ThisXStringClass*)this); - } +// ThisXStringClass& takeValueFromLiteral(const T* s) +// { +// if ( m_allocatedSize > 0 ) { +// panic_ask("XStringAbstract::takeValueFromLiteral -> m_allocatedSize > 0"); +// } +// super::__m_data = (T*)s; +//#ifdef XSTRING_CACHING_OF_SIZE +// super::__m_size = strlen(s); +//#endif +// return *((ThisXStringClass*)this); +// } public: @@ -866,32 +918,40 @@ public: void setEmpty() { - if ( m_allocatedSize <= 0 ) m_data = &nullChar; - else m_data[0] = 0; + if ( m_allocatedSize <= 0 ) super::__m_data = &nullChar; + else super::__m_data[0] = 0; + #ifdef XSTRING_CACHING_OF_SIZE + super::__m_size = 0; + #endif } - T* data() { return m_data; } - const T* data() const { return m_data; } +// T* data() { return data(); } + const T* data() const { return super::data(); } template - const T* data(IntegralType pos) const { return __String::_data(pos); } - template - T* data(IntegralType pos) { return __String::_data(pos); } + const T* data(IntegralType pos) const { return super::_data(pos); } +// template +// T* data(IntegralType pos) { return super::_data(pos); } template T* dataSized(IntegralType size) { -#ifdef DEBUG - if ( size<0 ) panic("T* dataSized() -> i < 0"); - if ( (unsigned_type(IntegralType))size > MAX_XSIZE ) panic("T* dataSized() -> i > MAX_XSIZE"); -#else - if ( size<0 ) return 0; - if ( (unsigned_type(IntegralType))size > MAX_XSIZE ) return 0; -#endif - - CheckSize((unsigned_type(IntegralType))size); - return __String::_data(0); + if ( size<0 ) { + panic_ask("T* dataSized() -> i < 0"); + return NULL; + } + if ( (unsigned_type(IntegralType))size > MAX_XSIZE ) { + panic_ask("T* dataSized() -> i > MAX_XSIZE"); + return NULL; + } + CheckSize((unsigned_type(IntegralType))size, 0); + return super::_data(0); } + void updateSize() { + #ifdef XSTRING_CACHING_OF_SIZE + super::__m_size = 0; + #endif + } // // // Pos is counted in logical char but size is counted in physical char (char, char16_t, char32_t or wchar_t) // template @@ -899,7 +959,7 @@ public: // { // if ( pos<0 ) panic("T* dataSized(xisize i, size_t sizeMin, size_t nGrowBy) -> i < 0"); // if ( size<0 ) panic("T* dataSized(xisize i, size_t sizeMin, size_t nGrowBy) -> i < 0"); -// size_t offset = size_of_utf_string_len(m_data, (typename _xtools__make_unsigned::type)pos); // If pos is too big, size_of_utf_string_len returns the end of the string +// size_t offset = size_of_utf_string_len(data(), (typename _xtools__make_unsigned::type)pos); // If pos is too big, size_of_utf_string_len returns the end of the string // CheckSize(offset + (typename _xtools__make_unsigned::type)size); // return _data(pos); // } @@ -907,8 +967,11 @@ public: T* forgetDataWithoutFreeing() { - T* ret = m_data; - m_data = &nullChar; + T* ret = super::__m_data; + super::__m_data = &nullChar; + #ifdef XSTRING_CACHING_OF_SIZE + super::__m_size = 0; + #endif m_allocatedSize = 0; return ret; } @@ -921,10 +984,13 @@ public: void strcpy(O otherChar) { if ( otherChar != 0) { - size_t newSize = utf_size_of_utf_string_len(m_data, &otherChar, 1); + size_t newSize = utf_size_of_utf_string_len(data(), &otherChar, 1); CheckSize(newSize, 0); - utf_string_from_utf_string_len(m_data, m_allocatedSize, &otherChar, 1); - m_data[newSize] = 0; + utf_string_from_utf_string_len(super::__m_data, m_allocatedSize, &otherChar, 1); + super::__m_data[newSize] = 0; + #ifdef XSTRING_CACHING_OF_SIZE + super::__m_size = newSize; + #endif }else{ setEmpty(); } @@ -934,10 +1000,14 @@ public: void strcpy(const O* other) { if ( other && *other ) { - size_t newSize = utf_size_of_utf_string(m_data, other); + size_t newSize = utf_size_of_utf_string(data(), other); CheckSize(newSize, 0); - utf_string_from_utf_string(m_data, m_allocatedSize, other); - m_data[newSize] = 0; + utf_string_from_utf_string(super::__m_data, m_allocatedSize, other); + super::__m_data[newSize] = 0; + #ifdef XSTRING_CACHING_OF_SIZE + super::__m_size = newSize; + XSTRING_CHECK_SIZE; + #endif }else{ setEmpty(); } @@ -947,10 +1017,14 @@ public: void strncpy(const O* other, size_t other_len) { if ( other && *other && other_len > 0 ) { - size_t newSize = utf_size_of_utf_string_len(m_data, other, other_len); + size_t newSize = utf_size_of_utf_string_len(data(), other, other_len); CheckSize(newSize, 0); - utf_string_from_utf_string_len(m_data, m_allocatedSize, other, other_len); - m_data[newSize] = 0; + utf_string_from_utf_string_len(super::__m_data, m_allocatedSize, other, other_len); + super::__m_data[newSize] = 0; + #ifdef XSTRING_CACHING_OF_SIZE + super::__m_size = newSize; + XSTRING_CHECK_SIZE; + #endif }else{ setEmpty(); } @@ -960,8 +1034,11 @@ public: { if ( other && *other && other_size > 0 ) { CheckSize(other_size, 0); - utf_string_from_utf_string_len(m_data, m_allocatedSize, other, other_size); - m_data[other_size] = 0; + utf_string_from_utf_string_size(super::__m_data, m_allocatedSize, other, other_size); // TODO:utf_string_from_utf_string_SIZE + super::__m_data[other_size] = 0; + #ifdef XSTRING_CACHING_OF_SIZE + super::__m_size = other_size; + #endif }else{ setEmpty(); } @@ -972,11 +1049,14 @@ public: void strcat(O otherChar) { if ( otherChar ) { - size_t currentSize = size_of_utf_string(m_data); - size_t newSize = currentSize + utf_size_of_utf_string_len(m_data, &otherChar, 1); - CheckSize(newSize, 0); - utf_string_from_utf_string_len(m_data+currentSize, m_allocatedSize, &otherChar, 1); - m_data[newSize] = 0; + size_t currentSize = super::size(); + size_t newSize = currentSize + utf_size_of_utf_string_len(data(), &otherChar, 1); + CheckSize(newSize); + utf_string_from_utf_string_len(super::__m_data+currentSize, m_allocatedSize, &otherChar, 1); + super::__m_data[newSize] = 0; + #ifdef XSTRING_CACHING_OF_SIZE + super::__m_size = newSize; + #endif }else{ // nothing to do } @@ -986,11 +1066,14 @@ public: void strcat(const O* other) { if ( other && *other ) { - size_t currentSize = size_of_utf_string(m_data); // size is number of T, not in bytes - size_t newSize = currentSize + utf_size_of_utf_string(m_data, other); // size is number of T, not in bytes - CheckSize(newSize, 0); - utf_string_from_utf_string(m_data+currentSize, m_allocatedSize-currentSize, other); - m_data[newSize] = 0; + size_t currentSize = super::size(); // size is number of T, not in bytes + size_t newSize = currentSize + utf_size_of_utf_string(data(), other); // size is number of T, not in bytes + CheckSize(newSize); + utf_string_from_utf_string(super::__m_data+currentSize, m_allocatedSize-currentSize, other); + super::__m_data[newSize] = 0; + #ifdef XSTRING_CACHING_OF_SIZE + super::__m_size = newSize; + #endif }else{ // nothing to do } @@ -999,23 +1082,31 @@ public: template void strcat(const __String& other) { - size_t currentSize = size_of_utf_string(m_data); // size is number of T, not in bytes - size_t newSize = currentSize + utf_size_of_utf_string(m_data, other.s()); // size is number of T, not in bytes - CheckSize(newSize, 0); - utf_string_from_utf_string(m_data+currentSize, m_allocatedSize-currentSize, other.s()); - m_data[newSize] = 0; + size_t currentSize = super::size(); // size is number of T, not in bytes + size_t newSize = currentSize + utf_size_of_utf_string(data(), other.s()); // size is number of T, not in bytes + CheckSize(newSize); + utf_string_from_utf_string(super::__m_data+currentSize, m_allocatedSize-currentSize, other.s()); + super::__m_data[newSize] = 0; + #ifdef XSTRING_CACHING_OF_SIZE + super::__m_size = newSize; + XSTRING_CHECK_SIZE; + #endif } /* strncat */ template void strncat(const O* other, size_t other_len) { if ( other && *other && other_len > 0 ) { - size_t currentSize = size_of_utf_string(m_data); - size_t other_size = utf_size_of_utf_string_len(m_data, other, other_len); + size_t currentSize = super::size(); + size_t other_size = utf_size_of_utf_string_len(data(), other, other_len); size_t newSize = currentSize + other_size; - CheckSize(newSize, 0); - utf_string_from_utf_string_len(m_data+currentSize, m_allocatedSize, other, other_len); - m_data[newSize] = 0; + CheckSize(newSize); + utf_string_from_utf_string_len(super::__m_data+currentSize, m_allocatedSize, other, other_len); + super::__m_data[newSize] = 0; + #ifdef XSTRING_CACHING_OF_SIZE + super::__m_size = newSize; + XSTRING_CHECK_SIZE; + #endif }else{ // nothing to do } @@ -1025,11 +1116,15 @@ public: void strsicat(const O* other, size_t other_size) { if ( other && *other && other_size > 0 ) { - size_t currentSize = size_of_utf_string(m_data); + size_t currentSize = super::size(); size_t newSize = currentSize + other_size; - CheckSize(newSize, 0); - utf_string_from_utf_string_len(m_data+currentSize, m_allocatedSize, other, other_size); - m_data[newSize] = 0; + CheckSize(newSize); + utf_string_from_utf_string_size(super::__m_data+currentSize, m_allocatedSize, other, other_size); + super::__m_data[newSize] = 0; + #ifdef XSTRING_CACHING_OF_SIZE + super::__m_size = newSize; + XSTRING_CHECK_SIZE; + #endif }else{ // nothing to do } @@ -1041,19 +1136,23 @@ public: { if ( !other || !*other ) return *((ThisXStringClass*)this); - size_t currentLength = __String::length(); + size_t currentLength = super::length(); if ( pos >= currentLength ) { strncat(other, other_len); return *((ThisXStringClass*)this); } - size_t currentSize = size_of_utf_string(m_data); - size_t otherSize = utf_size_of_utf_string_len(m_data, other, other_len); - CheckSize(currentSize+otherSize, 0); - size_t start = size_of_utf_string_len(m_data, pos); // size is number of T, not in bytes - memmove( m_data + start + otherSize, m_data + start, (currentSize-start+1)*sizeof(T)); // memmove handles overlapping memory move - utf_stringnn_from_utf_string(m_data+start, otherSize, other); -// m_data[newSize] = 0; + size_t currentSize = super::size(); + size_t otherSize = utf_size_of_utf_string_len(data(), other, other_len); + CheckSize(currentSize+otherSize); + size_t start = size_of_utf_string_len(data(), pos); // size is number of T, not in bytes + memmove( super::__m_data + start + otherSize, super::__m_data + start, (currentSize-start+1)*sizeof(T)); // memmove handles overlapping memory move + utf_stringnn_from_utf_string(super::__m_data+start, otherSize, other); +// data()[newSize] = 0; + #ifdef XSTRING_CACHING_OF_SIZE + super::__m_size = currentSize+otherSize; + XSTRING_CHECK_SIZE; + #endif return *((ThisXStringClass*)this); } @@ -1063,19 +1162,23 @@ public: { if ( !other || !*other ) return *((ThisXStringClass*)this); - size_t currentLength = __String::length(); + size_t currentLength = super::length(); if ( pos >= currentLength ) { strcat(other); return *((ThisXStringClass*)this); } - size_t currentSize = size_of_utf_string(m_data); - size_t otherSize = utf_size_of_utf_string(m_data, other); - CheckSize(currentSize+otherSize, 0); - size_t start = size_of_utf_string_len(m_data, pos); // size is number of T, not in bytes - memmove( m_data + start + otherSize, m_data + start, (currentSize-start+1)*sizeof(T)); // memmove handles overlapping memory move - utf_stringnn_from_utf_string(m_data+start, otherSize, other); -// m_data[newSize] = 0; + size_t currentSize = super::size(); + size_t otherSize = utf_size_of_utf_string(data(), other); + CheckSize(currentSize+otherSize); + size_t start = size_of_utf_string_len(data(), pos); // size is number of T, not in bytes + memmove( data() + start + otherSize, data() + start, (currentSize-start+1)*sizeof(T)); // memmove handles overlapping memory move + utf_stringnn_from_utf_string(data()+start, otherSize, other); +// data()[newSize] = 0; + #ifdef XSTRING_CACHING_OF_SIZE + super::__m_size = currentSize+otherSize; + XSTRING_CHECK_SIZE; + #endif return *((ThisXStringClass*)this); } /* insert char */ @@ -1087,45 +1190,54 @@ public: ThisXStringClass& deleteCharsAtPos(size_t pos, size_t count=1) { - size_t currentLength = __String::length(); + size_t currentLength = super::length(); if ( pos >= currentLength ) return *((ThisXStringClass*)this); - size_t currentSize = size_of_utf_string(m_data); // size is number of T, not in bytes + size_t currentSize = super::size(); // size is number of T, not in bytes CheckSize(currentSize, 0); // Although we only delete, we have to CheckSize in case this string point to a litteral. - size_t start = size_of_utf_string_len(m_data, pos); // size is number of T, not in bytes + size_t start = size_of_utf_string_len(data(), pos); // size is number of T, not in bytes // if ( pos+count >= currentLength ) count = currentLength - pos; if ( pos+count >= currentLength ) { - m_data[start] = 0; + super::__m_data[start] = 0; + #ifdef XSTRING_CACHING_OF_SIZE + super::__m_size = start; + #endif }else{ - size_t end = start + size_of_utf_string_len(m_data+start, count); // size is number of T, not in bytes - memmove( m_data + start, m_data + end, (currentSize-end+1)*sizeof(T)); // memmove handles overlapping memory move + size_t end = start + size_of_utf_string_len(data()+start, count); // size is number of T, not in bytes + memmove( super::__m_data + start, super::__m_data + end, (currentSize-end+1)*sizeof(T)); // memmove handles overlapping memory move + #ifdef XSTRING_CACHING_OF_SIZE + super::__m_size -= end-start; + #endif } // Handle length change when implementing caching length feature. + #ifdef XSTRING_CACHING_OF_SIZE + XSTRING_CHECK_SIZE; + #endif return *((ThisXStringClass*)this); } ThisXStringClass& replaceAll(char32_t charToSearch, char32_t charToReplaceBy) { - size_t currentSize = __String::sizeInNativeChars(); // size is number of T, not in bytes - size_t charToSearchSize = utf_size_of_utf_string_len(m_data, &charToSearch, 1); // size is number of T, not in bytes - size_t charToReplaceBySize = utf_size_of_utf_string_len(m_data, &charToReplaceBy, 1); // size is number of T, not in bytes + size_t currentSize = super::sizeInNativeChars(); // size is number of T, not in bytes + size_t charToSearchSize = utf_size_of_utf_string_len(data(), &charToSearch, 1); // size is number of T, not in bytes + size_t charToReplaceBySize = utf_size_of_utf_string_len(data(), &charToReplaceBy, 1); // size is number of T, not in bytes // careful because 'charToReplaceBySize - charToSearchSize' overflows when charToSearchSize > charToReplaceBySize, which happens. char32_t char32; - T* previousData = m_data; - T* previousP = m_data; + T* previousData = super::__m_data; + T* previousP = super::__m_data; T* p = get_char32_from_string(previousP, &char32); while ( char32 ) { if (!char32) break; if ( char32 == charToSearch ) { if ( CheckSize(currentSize + charToReplaceBySize - charToSearchSize) ) { - previousP = m_data + ( previousP - previousData ); - p = m_data + ( p - previousData ); - previousData = m_data; + previousP = super::__m_data + ( previousP - previousData ); // CheckSize have reallocated. Correct previousP, p and previousData. + p = super::__m_data + ( p - previousData ); + previousData = super::__m_data; } - memmove(p+charToReplaceBySize-charToSearchSize, p, uintptr_t(m_data + currentSize - p + 1)*sizeof(T)); + memmove(p+charToReplaceBySize-charToSearchSize, p, uintptr_t(super::__m_data + currentSize - p + 1)*sizeof(T)); p += charToReplaceBySize; p -= charToSearchSize; currentSize += charToReplaceBySize; @@ -1135,32 +1247,36 @@ public: previousP = p; p = get_char32_from_string(previousP, &char32); } + #ifdef XSTRING_CACHING_OF_SIZE + super::__m_size = currentSize; + XSTRING_CHECK_SIZE; + #endif return *((ThisXStringClass*)this); } template ThisXStringClass& replaceAll(const OtherXStringClass1& search, const OtherXStringClass2& replaceBy ) { - size_t currentSize = __String::sizeInNativeChars(); // size is number of T, not in bytes + size_t currentSize = super::sizeInNativeChars(); // size is number of T, not in bytes size_t sizeLeft = currentSize; // size is number of T, not in bytes - size_t searchSize = utf_size_of_utf_string(m_data, search.s()); // size is number of T, not in bytes - size_t replaceBySize = utf_size_of_utf_string(m_data, replaceBy.s()); // size is number of T, not in bytes + size_t searchSize = utf_size_of_utf_string(data(), search.s()); // size is number of T, not in bytes + size_t replaceBySize = utf_size_of_utf_string(data(), replaceBy.s()); // size is number of T, not in bytes // careful because 'charToReplaceBySize - charToSearchSize' overflows when charToSearchSize > charToReplaceBySize, which happens. -// size_t pos = __String::indexOf(search); - T* previousData = m_data; - T* previousP = m_data; - T* p = m_data; +// size_t pos = super::indexOf(search); + T* previousData = super::__m_data; + T* previousP = super::__m_data; + T* p = super::__m_data; size_t pos = XStringAbstract__indexOf((const T**)&p, search.s(), 0, false); while ( pos != MAX_XSIZE ) { if ( CheckSize(currentSize + replaceBySize - searchSize) ) { - previousP = m_data + ( previousP - previousData ); - p = m_data + ( p - previousData ); - previousData = m_data; + previousP = super::__m_data + ( previousP - previousData ); + p = super::__m_data + ( p - previousData ); + previousData = super::__m_data; } sizeLeft -= uintptr_t(p-previousP); memmove(p+replaceBySize, p+searchSize, (sizeLeft - searchSize + 1)*sizeof(T)); -// memmove(m_data+pos+replaceBySize-searchSize, m_data+pos, (currentSize - pos + 1)*sizeof(T)); +// memmove(data()+pos+replaceBySize-searchSize, data()+pos, (currentSize - pos + 1)*sizeof(T)); utf_stringnn_from_utf_string(p, replaceBySize, replaceBy.s()); p += replaceBySize; currentSize += replaceBySize; @@ -1170,36 +1286,47 @@ public: previousP = p; pos = XStringAbstract__indexOf((const T**)&p, search.s(), 0, false); } + #ifdef XSTRING_CACHING_OF_SIZE + super::__m_size = currentSize; + XSTRING_CHECK_SIZE; + #endif return *((ThisXStringClass*)this); } void trim() { - size_t lengthInNativeBytes = __String::sizeInNativeChars(); + size_t lengthInNativeBytes = super::sizeInNativeChars(); if ( lengthInNativeBytes == 0 ) return; T* start = 0; - size_t count = 0; - T* s = m_data; + T* s = super::__m_data; while ( *s && unsigned_type(T)(*s) <= 32 ) s++; if ( !*s ) { - m_data[0] = 0; + super::__m_data[0] = 0; + #ifdef XSTRING_CACHING_OF_SIZE + super::__m_size = 0; + XSTRING_CHECK_SIZE; + #endif return; } start = s; - s = m_data + lengthInNativeBytes - 1; + s = super::__m_data + lengthInNativeBytes - 1; while ( *s && unsigned_type(T)(*s) <= 32 ) s--; - count = uintptr_t(s - start) + 1; - CheckSize(count); // We have to CheckSize in case this string point to a litteral. - memmove(m_data, start, count*sizeof(T)); - m_data[count] = 0; + size_t newSize = uintptr_t(s - start) + 1; + CheckSize(newSize, 0); // We have to CheckSize in case this string point to a litteral. + memmove(super::__m_data, start, newSize*sizeof(T)); + super::__m_data[newSize] = 0; + #ifdef XSTRING_CACHING_OF_SIZE + super::__m_size = newSize; + XSTRING_CHECK_SIZE; + #endif } void lowerAscii() { - size_t currentSize = size_of_utf_string(m_data); // size is number of T, not in bytes + size_t currentSize = super::size(); // size is number of T, not in bytes CheckSize(currentSize, 0); // We have to CheckSize in case this string point to a litteral. - T* s = m_data; + T* s = super::__m_data; while ( *s ) { *s = asciiToLower(*s); s++; @@ -1208,9 +1335,9 @@ public: void upperAscii() { - size_t currentSize = size_of_utf_string(m_data); // size is number of T, not in bytes + size_t currentSize = super::size(); // size is number of T, not in bytes CheckSize(currentSize, 0); // We have to CheckSize in case this string point to a litteral. - T* s = m_data; + T* s = super::__m_data; while ( *s ) { *s = asciiToUpper(*s); s++; @@ -1218,36 +1345,49 @@ public: } /* size is in number of technical chars, NOT in bytes */ - ThisXStringClass& stealValueFrom(T* S, size_t size) { - if ( m_allocatedSize > 0 ) free((void*)m_data); - m_data = S; - m_allocatedSize = size; + ThisXStringClass& stealValueFrom(T* S, size_t allocatedSize) { + if ( m_allocatedSize > 0 ) delete super::__m_data; + super::__m_data = S; + #ifdef XSTRING_CACHING_OF_SIZE + super::__m_size = utf_size_of_utf_string(super::__m_data, super::__m_data); + #endif + m_allocatedSize = allocatedSize; return *((ThisXStringClass*)this); } + // Not sure we should keep that. We cannot know the allocated size. Therefore, a future realloc may fail as EDK want the old size. ThisXStringClass& stealValueFrom(T* S) { - if ( m_allocatedSize > 0 ) free((void*)m_data); - m_data = S; - m_allocatedSize = utf_size_of_utf_string(m_data, S) + 1; + if ( m_allocatedSize > 0 ) delete super::__m_data; + super::__m_data = S; + #ifdef XSTRING_CACHING_OF_SIZE + super::__m_size = utf_size_of_utf_string(super::__m_data, super::__m_data); + m_allocatedSize = super::__m_size + 1; + #else + m_allocatedSize = super::size() + 1; + #endif return *((ThisXStringClass*)this); } ThisXStringClass& stealValueFrom(ThisXStringClass* S) { - if ( m_allocatedSize > 0 ) free((void*)m_data); + if ( m_allocatedSize > 0 ) delete super::__m_data; + #ifdef XSTRING_CACHING_OF_SIZE + super::__m_size = S->size(); + #endif m_allocatedSize = S->m_allocatedSize; - m_data = S->forgetDataWithoutFreeing(); + // do forgetDataWithoutFreeing() last : it'll zero the value of size and m_allocatedSize + super::__m_data = S->forgetDataWithoutFreeing(); return *((ThisXStringClass*)this); } /* takeValueFrom */ template - ThisXStringClass& takeValueFrom(const __String& S) { strcpy(S.s()); return *((ThisXStringClass*)this); } + ThisXStringClass& takeValueFrom(const __String& S) { *this = S; return *((ThisXStringClass*)this); } template ThisXStringClass& takeValueFrom(const O* S) { strcpy(S); return *((ThisXStringClass*)this); } template ThisXStringClass& takeValueFrom(const O C) { strcpy(C); return *((ThisXStringClass*)this); } - template - ThisXStringClass& takeValueFrom(const __String& S, size_t len) { strncpy(S.s(), len); return *((ThisXStringClass*)this); } +// template +// ThisXStringClass& takeValueFrom(const __String& S, size_t len) { strncpy(S.s(), len); return *((ThisXStringClass*)this); } template ThisXStringClass& takeValueFrom(const O* S, size_t len) { strncpy(S, len); return *((ThisXStringClass*)this); } @@ -1278,7 +1418,7 @@ typename __string_class_or::type operator + (T1 p1, T2 p2) { typename __ #undef DBG_XSTRING #undef asciiToLower -#undef m_data +//#undef data() #endif // __XSTRINGABSTRACT_H__ diff --git a/rEFIt_UEFI/cpp_foundation/unicode_conversions.cpp b/rEFIt_UEFI/cpp_foundation/unicode_conversions.cpp index de70d9e53..8f0d478d1 100755 --- a/rEFIt_UEFI/cpp_foundation/unicode_conversions.cpp +++ b/rEFIt_UEFI/cpp_foundation/unicode_conversions.cpp @@ -5,6 +5,7 @@ // #include "unicode_conversions.h" +#include #ifdef __cplusplus extern "C" { @@ -697,6 +698,29 @@ size_t utf16_string_from_utf8_string_len(char16_t* dst, size_t dst_max_size, con return (size_t)(p-dst); } +size_t utf16_string_from_utf8_string_size(char16_t* dst, size_t dst_max_size, const char* s, size_t size) +{ + if ( dst_max_size <= 0 ) return 0; + if ( !s || size <= 0 ) { + *dst = 0; + return 0; + } + dst_max_size -= 1; + +// size_t dst_len = 0; + const char* s_start = s; + char16_t* p = dst; +// char16_t* p_max = dst + dst_max_size; + + char32_t char32 = 1; + while ( char32 && dst_max_size > 0 && uintptr_t(s)-uintptr_t(s_start) < size ) { + s = get_char32_from_utf8_string(s, &char32); + p = get_utf16_from_char32(p, &dst_max_size, char32); + } + *p = 0; + return (size_t)(p-dst); +} + /************************************************************* utf16 - utf32 *********************************************************/ @@ -1247,16 +1271,22 @@ char32_t get_char32_from_wchar_string_at_pos(const char16_t* s, size_t pos) size_t utf8_size_of_utf8_string(const char* s) { if ( !s ) return 0; - char32_t char32 = 1; - const char* p = s; // = get_char32_from_utf8_string(s, &char32); - while ( char32 ) { - p = get_char32_from_utf8_string(p, &char32); - } - return (uintptr_t)p - (uintptr_t)s; -// -// const char* p = s; -// while ( *p++ ); -// return (size_t)(p-s-1); +////2021 : tested on macOS. With this version, test took 8 seconds. +// char32_t char32 = 1; +// const char* p = s; // = get_char32_from_utf8_string(s, &char32); +// while ( char32 ) { +// p = get_char32_from_utf8_string(p, &char32); +// } +// return (uintptr_t)p - (uintptr_t)s; + + return strlen(s);// With this version, test took 0.2 seconds. strlen on macOs is optimized for SSE. + +// return clover_strlen(s); // With this version, test took 0.4 seconds. + +//// 2021 : // With this version, test took 2.2 seconds. +// const char* p = s; +// while ( *p++ ); +// return (uintptr_t)p - (uintptr_t)s - 1; } size_t utf8_size_of_utf8_string_len(const char* s, size_t len) @@ -1381,21 +1411,32 @@ size_t utf8_string_from_utf8_string(char* dst, size_t dst_max_size, const char * size_t utf8_string_from_utf8_string_len(char* dst, size_t dst_max_size, const char *s, size_t len) { - if ( !s || len <= 0 || dst_max_size <= 1 ) { - if ( dst_max_size > 0 ) *dst = 0; - return 0; - } - dst_max_size -= 1; - char* p = dst; - char32_t char32; - s = get_char32_from_utf8_string(s, &char32); - while ( char32 && dst_max_size > 0 && len > 0) { - p = get_utf8_from_char32(p, &dst_max_size, char32); - s = get_char32_from_utf8_string(s, &char32); - len--; - } - *p = 0; - return (uintptr_t)p - (uintptr_t)dst - 1; + if ( !s || len <= 0 || dst_max_size <= 1 ) { + if ( dst_max_size > 0 ) *dst = 0; + return 0; + } + dst_max_size -= 1; + char* p = dst; + char32_t char32; + s = get_char32_from_utf8_string(s, &char32); + while ( char32 && dst_max_size > 0 && len > 0) { + p = get_utf8_from_char32(p, &dst_max_size, char32); + s = get_char32_from_utf8_string(s, &char32); + len--; + } + *p = 0; + return (uintptr_t)p - (uintptr_t)dst - 1; +} + +size_t utf8_string_from_utf8_string_size(char* dst, size_t dst_max_size, const char *s, size_t size) +{ + if ( !s || size <= 0 || dst_max_size <= 1 ) { + if ( dst_max_size > 0 ) *dst = 0; + return 0; + } + memmove(dst, s, MIN(size, dst_max_size-1)); + dst[MIN(size, dst_max_size-1)] = 0; + return MIN(size, dst_max_size-1); } size_t utf16_stringnn_from_utf16_string(char16_t* dst, size_t dst_max_size, const char16_t *s) @@ -1471,6 +1512,17 @@ size_t utf16_string_from_utf16_string_len(char16_t* dst, size_t dst_max_size, co return (uintptr_t)p - (uintptr_t)dst - 1; } +size_t utf16_string_from_utf16_string_size(char16_t* dst, size_t dst_max_size, const char16_t *s, size_t size) +{ + if ( !s || size <= 0 || dst_max_size <= 1 ) { + if ( dst_max_size > 0 ) *dst = 0; + return 0; + } + memmove(dst, s, MIN(size, dst_max_size-1)*sizeof(char16_t)); + dst[MIN(size, dst_max_size-1)] = 0; + return MIN(size, dst_max_size); +} + size_t utf32_stringnn_from_utf32_string(char32_t* dst, size_t dst_max_size, const char32_t *s) { if ( !s || dst_max_size <= 0 ) { @@ -1523,6 +1575,17 @@ size_t utf32_string_from_utf32_string_len(char32_t* dst, size_t dst_max_size, co return dst_max_size * sizeof(char32_t); } +size_t utf32_string_from_utf32_string_size(char32_t* dst, size_t dst_max_size, const char32_t *s, size_t size) +{ + if ( !s || size <= 0 || dst_max_size <= 1 ) { + if ( dst_max_size > 0 ) *dst = 0; + return 0; + } + memmove(dst, s, MIN(size, dst_max_size-1)*sizeof(char32_t)); + dst[MIN(size, dst_max_size-1)] = 0; + return MIN(size, dst_max_size); +} + size_t wchar_stringnn_from_wchar_string(wchar_t* dst, size_t dst_max_size, const wchar_t *s) { #if __WCHAR_MAX__ <= 0xFFFFu diff --git a/rEFIt_UEFI/cpp_foundation/unicode_conversions.h b/rEFIt_UEFI/cpp_foundation/unicode_conversions.h index 52a8d6109..f16c49b77 100644 --- a/rEFIt_UEFI/cpp_foundation/unicode_conversions.h +++ b/rEFIt_UEFI/cpp_foundation/unicode_conversions.h @@ -99,13 +99,23 @@ char32_t get_char32_from_utf8_string_at_pos(const char* s, size_t n); * Return value : size */ size_t utf8_size_of_utf32_string(const char32_t* s); + /* - * Size in bytes of an utf32 string of len char if it were converted to utf8 - * Return value : pointer to the end of string or at the error + * Size in bytes of an utf32 string of at most len char if it were converted to utf8 + * Return value : size */ size_t utf8_size_of_utf32_string_len(const char32_t* s, size_t len); +/* +* Size in bytes of an utf8 string of at most len char if it were converted to utf32 +* Return value : size +*/ size_t utf32_size_of_utf8_string(const char* s); + +/* +* Size in bytes of an utf8 string of at most len char if it were converted to utf8 +* Return value : size, <= len +*/ size_t utf32_size_of_utf8_string_len(const char* s, size_t len); /* @@ -146,6 +156,7 @@ size_t utf8_string_from_utf16_string_len(char* dst, size_t dst_max_size, const c size_t utf16_stringnn_from_utf8_string(char16_t* dst, size_t dst_max_size, const char* s); size_t utf16_string_from_utf8_string(char16_t* dst, size_t dst_max_size, const char* s); size_t utf16_string_from_utf8_string_len(char16_t* dst, size_t dst_max_size, const char* s, size_t len); +size_t utf16_string_from_utf8_string_size(char16_t* dst, size_t dst_max_size, const char* s, size_t size); /****** utf16 - utf32 *****/ @@ -235,12 +246,15 @@ size_t wchar_size_of_wchar_string_len(const wchar_t* s, size_t len); size_t utf8_stringnn_from_utf8_string(char* dst, size_t dst_max_size, const char *s); size_t utf8_string_from_utf8_string(char* dst, size_t dst_max_size, const char *s); size_t utf8_string_from_utf8_string_len(char* dst, size_t dst_max_size, const char *s, size_t len); +size_t utf8_string_from_utf8_string_size(char* dst, size_t dst_max_size, const char *s, size_t size); size_t utf16_stringnn_from_utf16_string(char16_t* dst, size_t dst_max_size, const char16_t *s); size_t utf16_string_from_utf16_string(char16_t* dst, size_t dst_max_size, const char16_t *s); size_t utf16_string_from_utf16_string_len(char16_t* dst, size_t dst_max_size, const char16_t *s, size_t len); +size_t utf16_string_from_utf16_string_size(char16_t* dst, size_t dst_max_size, const char16_t *s, size_t size); size_t utf32_stringnn_from_utf32_string(char32_t* dst, size_t dst_max_size, const char32_t *s); size_t utf32_string_from_utf32_string(char32_t* dst, size_t dst_max_size, const char32_t *s); size_t utf32_string_from_utf32_string_len(char32_t* dst, size_t dst_max_size, const char32_t *s, size_t len); +size_t utf32_string_from_utf32_string_size(char32_t* dst, size_t dst_max_size, const char32_t *s, size_t size); size_t wchar_stringnn_from_wchar_string(wchar_t* dst, size_t dst_max_size, const wchar_t *s); size_t wchar_string_from_wchar_string(wchar_t* dst, size_t dst_max_size, const wchar_t *s); size_t wchar_string_from_wchar_string_len(wchar_t* dst, size_t dst_max_size, const wchar_t *s, size_t len); @@ -301,10 +315,10 @@ inline size_t size_of_utf_string(const char32_t* s) { return utf32_size_of_utf32 inline size_t size_of_utf_string(const wchar_t* s) { return size_of_utf_string((wchar_cast*)s); } /* Returns amount of utf chars. Type of utf chars are determined by the first parameter. */ -inline size_t utf_size_of_utf_string(const char*, const char* s) { return utf8_size_of_utf8_string(s); } -inline size_t utf_size_of_utf_string(const char16_t*, const char* s) { return utf16_size_of_utf8_string(s); } -inline size_t utf_size_of_utf_string(const char32_t*, const char* s) { return utf32_size_of_utf8_string(s); } -inline size_t utf_size_of_utf_string(const wchar_t* t, const char* s) { return utf_size_of_utf_string((wchar_cast*)t, s); } +inline size_t utf_size_of_utf_string(const char* dummy, const char* s) { return utf8_size_of_utf8_string(s); } +inline size_t utf_size_of_utf_string(const char16_t* dummy, const char* s) { return utf16_size_of_utf8_string(s); } +inline size_t utf_size_of_utf_string(const char32_t* dummy, const char* s) { return utf32_size_of_utf8_string(s); } +inline size_t utf_size_of_utf_string(const wchar_t* dummy, const char* s) { return utf_size_of_utf_string((wchar_cast*)dummy, s); } inline size_t utf_size_of_utf_string(const char*, const char16_t* s) { return utf8_size_of_utf16_string(s); } inline size_t utf_size_of_utf_string(const char16_t*, const char16_t* s) { return utf16_size_of_utf16_string(s); } @@ -376,7 +390,7 @@ inline size_t utf_string_from_utf_string(char32_t* dst, size_t dst_max_size, con inline size_t utf_string_from_utf_string(wchar_t* dst, size_t dst_max_size, const wchar_t *s) { return utf_string_from_utf_string(dst, dst_max_size, (wchar_cast*)s); } - +// utf_stringnn... do not add NULL at the end after conversion inline size_t utf_stringnn_from_utf_string(char* dst, size_t dst_max_size, const char* s) { return utf8_stringnn_from_utf8_string(dst, dst_max_size, s); } inline size_t utf_stringnn_from_utf_string(char16_t* dst, size_t dst_max_size, const char* s) { return utf16_stringnn_from_utf8_string(dst, dst_max_size, s); } inline size_t utf_stringnn_from_utf_string(char32_t* dst, size_t dst_max_size, const char* s) { return utf32_stringnn_from_utf8_string(dst, dst_max_size, s); } @@ -424,6 +438,28 @@ inline size_t utf_string_from_utf_string_len(wchar_t* dst, size_t dst_max_size, +inline size_t utf_string_from_utf_string_size(char* dst, size_t dst_max_size, const char* s, size_t size) { return utf8_string_from_utf8_string_size(dst, dst_max_size, s, size); } +inline size_t utf_string_from_utf_string_size(char16_t* dst, size_t dst_max_size, const char* s, size_t size) { return utf16_string_from_utf8_string_size(dst, dst_max_size, s, size); } +//inline size_t utf_string_from_utf_string_size(char32_t* dst, size_t dst_max_size, const char* s, size_t size) { return utf32_string_from_utf8_string_size(dst, dst_max_size, s, size); } +inline size_t utf_string_from_utf_string_size(wchar_t* dst, size_t dst_max_size, const char* s, size_t size) { return utf_string_from_utf_string_size((wchar_cast*)dst, dst_max_size, s, size); } +// +//inline size_t utf_string_from_utf_string_size(char* dst, size_t dst_max_size, const char16_t * s, size_t size) { return utf8_string_from_utf16_string_size(dst, dst_max_size, s, size); } +inline size_t utf_string_from_utf_string_size(char16_t* dst, size_t dst_max_size, const char16_t * s, size_t size) { return utf16_string_from_utf16_string_size(dst, dst_max_size, s, size); } +//inline size_t utf_string_from_utf_string_size(char32_t* dst, size_t dst_max_size, const char16_t * s, size_t size) { return utf32_string_from_utf16_string_size(dst, dst_max_size, s, size); } +inline size_t utf_string_from_utf_string_size(wchar_t* dst, size_t dst_max_size, const char16_t * s, size_t size) { return utf_string_from_utf_string_size((wchar_cast*)dst, dst_max_size, s, size); } +// +//inline size_t utf_string_from_utf_string_size(char* dst, size_t dst_max_size, const char32_t * s, size_t size) { return utf8_string_from_utf32_string_size(dst, dst_max_size, s, size); } +//inline size_t utf_string_from_utf_string_size(char16_t* dst, size_t dst_max_size, const char32_t * s, size_t size) { return utf16_string_from_utf32_string_size(dst, dst_max_size, s, size); } +inline size_t utf_string_from_utf_string_size(char32_t* dst, size_t dst_max_size, const char32_t * s, size_t size) { return utf32_string_from_utf32_string_size(dst, dst_max_size, s, size); } +//inline size_t utf_string_from_utf_string_size(wchar_t* dst, size_t dst_max_size, const char32_t * s, size_t size) { return utf_string_from_utf_string_size((wchar_cast*)dst, dst_max_size, s, size); } +// +//inline size_t utf_string_from_utf_string_size(char* dst, size_t dst_max_size, const wchar_t * s, size_t size) { return utf_string_from_utf_string_size(dst, dst_max_size, (wchar_cast*)s, size); } +//inline size_t utf_string_from_utf_string_size(char16_t* dst, size_t dst_max_size, const wchar_t * s, size_t size) { return utf_string_from_utf_string_size(dst, dst_max_size, (wchar_cast*)s, size); } +//inline size_t utf_string_from_utf_string_size(char32_t* dst, size_t dst_max_size, const wchar_t * s, size_t size) { return utf_string_from_utf_string_size(dst, dst_max_size, (wchar_cast*)s, size); } +inline size_t utf_string_from_utf_string_size(wchar_t* dst, size_t dst_max_size, const wchar_t * s, size_t size) { return utf_string_from_utf_string_size(dst, dst_max_size, (wchar_cast*)s, size); } + + + #endif // __cplusplus diff --git a/rEFIt_UEFI/entry_scan/common.cpp b/rEFIt_UEFI/entry_scan/common.cpp index 62e3d836a..a08d2f66f 100644 --- a/rEFIt_UEFI/entry_scan/common.cpp +++ b/rEFIt_UEFI/entry_scan/common.cpp @@ -364,8 +364,8 @@ BOOLEAN YesNoMessage(IN XStringW& Title, IN CONST XStringW& Message) return Result; } // Ask user for file path from directory menu -BOOLEAN AskUserForFilePathFromDir(IN CHAR16 *Title OPTIONAL, IN REFIT_VOLUME *Volume, - IN CHAR16 *ParentPath OPTIONAL, const EFI_FILE *Dir, +BOOLEAN AskUserForFilePathFromDir(const CHAR16 *Title OPTIONAL, IN REFIT_VOLUME *Volume, + const CHAR16 *ParentPath OPTIONAL, const EFI_FILE *Dir, OUT EFI_DEVICE_PATH_PROTOCOL **Result) { //REFIT_MENU_SCREEN Menu = { 0, L"Please Select File...", NULL, 0, NULL, 0, NULL, @@ -456,7 +456,7 @@ BOOLEAN AskUserForFilePath(IN CHAR16 *Title OPTIONAL, IN EFI_DEVICE_PATH_PROTOCO // If the path begins with this volumes path it matches if (StrniCmp(DevicePathStr.wc_str(), Volume->DevicePathString.wc_str(), Volume->DevicePathString.length())) { // Need to - CHAR16 *FilePath = DevicePathStr.data(Volume->DevicePathString.length()); + const CHAR16 *FilePath = DevicePathStr.data(Volume->DevicePathString.length()); UINTN FileLength = StrLen(FilePath); if (FileLength == 0) { // If there is no path left then open the root diff --git a/rEFIt_UEFI/entry_scan/entry_scan.h b/rEFIt_UEFI/entry_scan/entry_scan.h index ad1a827cc..38945f90a 100644 --- a/rEFIt_UEFI/entry_scan/entry_scan.h +++ b/rEFIt_UEFI/entry_scan/entry_scan.h @@ -48,8 +48,8 @@ const XIcon& ScanVolumeDefaultIcon(REFIT_VOLUME *Volume, IN UINT8 OSType, const // Ask user for file path from directory menu -BOOLEAN AskUserForFilePathFromDir(IN CHAR16 *Title OPTIONAL, IN REFIT_VOLUME *Volume, - IN CHAR16 *ParentPath, const EFI_FILE *Dir, +BOOLEAN AskUserForFilePathFromDir(const CHAR16 *Title OPTIONAL, IN REFIT_VOLUME *Volume, + const CHAR16 *ParentPath, const EFI_FILE *Dir, OUT EFI_DEVICE_PATH_PROTOCOL **Result); // Ask user for file path from volumes menu BOOLEAN AskUserForFilePathFromVolumes(IN CHAR16 *Title OPTIONAL, OUT EFI_DEVICE_PATH_PROTOCOL **Result); diff --git a/rEFIt_UEFI/entry_scan/loader.cpp b/rEFIt_UEFI/entry_scan/loader.cpp index 1c497088f..f6c429af3 100644 --- a/rEFIt_UEFI/entry_scan/loader.cpp +++ b/rEFIt_UEFI/entry_scan/loader.cpp @@ -798,8 +798,8 @@ void LOADER_ENTRY::AddDefaultMenu() BOOLEAN KernelIs64BitOnly; // UINT64 os_version = AsciiOSVersionToUint64(OSVersion); - constexpr LString8 quietLitteral = "quiet"; - constexpr LString8 splashLitteral = "splash"; + constexpr LString8 quietLitteral = "quiet"_XS8; + constexpr LString8 splashLitteral = "splash"_XS8; // Only kernels up to 10.7 have 32-bit mode KernelIs64BitOnly = (macOSVersion.isEmpty() || diff --git a/rEFIt_UEFI/gui/menu_items/menu_items.h b/rEFIt_UEFI/gui/menu_items/menu_items.h index 767361a42..79ea4c341 100644 --- a/rEFIt_UEFI/gui/menu_items/menu_items.h +++ b/rEFIt_UEFI/gui/menu_items/menu_items.h @@ -270,7 +270,7 @@ class REFIT_ABSTRACT_MENU_ENTRY XIcon BadgeImage; REFIT_MENU_ITEM_ABSTRACT_ENTRY_LOADER() - : REFIT_ABSTRACT_MENU_ENTRY(), DevicePathString(0), LoadOptions(), LoaderPath(), DriveImage(), BadgeImage() + : REFIT_ABSTRACT_MENU_ENTRY(), DevicePathString(), LoadOptions(), LoaderPath(), DriveImage(), BadgeImage() {} REFIT_MENU_ITEM_ABSTRACT_ENTRY_LOADER(const REFIT_MENU_ITEM_ABSTRACT_ENTRY_LOADER&) = delete; REFIT_MENU_ITEM_ABSTRACT_ENTRY_LOADER& operator=(const REFIT_MENU_ITEM_ABSTRACT_ENTRY_LOADER&) = delete; diff --git a/rEFIt_UEFI/libeg/libeg.h b/rEFIt_UEFI/libeg/libeg.h index 74d51e1ca..eec2e0868 100755 --- a/rEFIt_UEFI/libeg/libeg.h +++ b/rEFIt_UEFI/libeg/libeg.h @@ -114,20 +114,13 @@ typedef enum { class INPUT_ITEM { public: - ITEM_TYPE ItemType; //string, value, boolean - BOOLEAN Valid; - UINT8 BValue; // was BOOLEAN, but value 2 is sometimes assigned. - UINT8 Pad8; - UINT32 IValue; - // UINT64 UValue; - // CHAR8* AValue; - XStringW SValue; - UINTN LineShift; - - INPUT_ITEM() : ItemType(BoolValue), Valid(0), BValue(0), Pad8(0), IValue(0), SValue(0), LineShift(0) {}; - INPUT_ITEM(const INPUT_ITEM& other) = default; // default is fine if there is only native type and objects that have copy ctor - INPUT_ITEM& operator = ( const INPUT_ITEM & ) = default; // default is fine if there is only native type and objects that have copy ctor - ~INPUT_ITEM() { } + ITEM_TYPE ItemType = BoolValue; //string, value, boolean + BOOLEAN Valid = 0; + UINT8 BValue = 0; // was BOOLEAN, but value 2 is sometimes assigned. + //UINT8 Pad8; + UINT32 IValue = 0; + XStringW SValue = XStringW(); + UINTN LineShift = 0; }; typedef struct {