diff --git a/rEFIt_UEFI/Platform/Utils.cpp b/rEFIt_UEFI/Platform/Utils.cpp index d584fc744..38d77baa9 100755 --- a/rEFIt_UEFI/Platform/Utils.cpp +++ b/rEFIt_UEFI/Platform/Utils.cpp @@ -142,23 +142,6 @@ UINT32 GetCrc32(UINT8 *Buffer, UINTN Size) return x; } -//#ifndef UNIT_TESTS_MACOS - -extern "C" { -#include -} - -void displayFreeMemory(const XString8& prefix) -{ - UINTN LowMemory; - UINTN TotalMemory; - - TotalMemory = OcCountFreePages (&LowMemory); - DebugLog(1, "--> %s: Firmware has %llu free pages (%llu in lower 4 GB)\n", prefix.c_str(), TotalMemory, LowMemory); -} - -//#endif - XBool haveError = false; diff --git a/rEFIt_UEFI/Platform/Utils.h b/rEFIt_UEFI/Platform/Utils.h index 1b49c578c..d3f918682 100755 --- a/rEFIt_UEFI/Platform/Utils.h +++ b/rEFIt_UEFI/Platform/Utils.h @@ -130,10 +130,5 @@ extern XBool haveError; #endif // __cplusplus -//#ifndef UNIT_TESTS_MACOS -extern "C" { -void displayFreeMemory(const XString8& prefix); -} -//#endif #endif // _UTILS_H_ diff --git a/rEFIt_UEFI/Platform/UtilsEFI.cpp b/rEFIt_UEFI/Platform/UtilsEFI.cpp new file mode 100755 index 000000000..60b3c09ff --- /dev/null +++ b/rEFIt_UEFI/Platform/UtilsEFI.cpp @@ -0,0 +1,26 @@ +///*++ +// +//All rights reserved. This program and the accompanying materials +//are licensed and made available under the terms and conditions of the BSD License +//which accompanies this distribution. The full text of the license may be found at +//http://opensource.org/licenses/bsd-license.php +// +//THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +//WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +// +// +#include // Only use angled for Platform, else, xcode project won't compile +#include + +extern "C" { +#include +} + +void displayFreeMemory(const XString8& prefix) +{ + UINTN LowMemory; + UINTN TotalMemory; + + TotalMemory = OcCountFreePages (&LowMemory); + DebugLog(1, "--> %s: Firmware has %llu free pages (%llu in lower 4 GB)\n", prefix.c_str(), TotalMemory, LowMemory); +} diff --git a/rEFIt_UEFI/Platform/UtilsEFI.h b/rEFIt_UEFI/Platform/UtilsEFI.h new file mode 100755 index 000000000..a12a8387e --- /dev/null +++ b/rEFIt_UEFI/Platform/UtilsEFI.h @@ -0,0 +1,20 @@ +// +//All rights reserved. This program and the accompanying materials +//are licensed and made available under the terms and conditions of the BSD License +//which accompanies this distribution. The full text of the license may be found at +//http://opensource.org/licenses/bsd-license.php +// +//THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +//WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +// +// + +#ifndef _UTILSEFI_H_ +#define _UTILSEFI_H_ + +//extern "C" { +void displayFreeMemory(const XString8& prefix); +//} + + +#endif // _UTILSEFI_H_