CloverBootloader/rEFIt_UEFI/cpp_util/memory.cpp

40 lines
751 B
C++
Raw Normal View History

2020-02-17 21:41:09 +01:00
#include <Platform.h> // Only use angled for Platform, else, xcode project won't compile
2020-02-17 21:41:09 +01:00
extern "C" {
/*
* memset and memcpy has to be provided for clang
*/
2020-02-21 10:44:15 +01:00
#if !defined(_MSC_VER)
2020-02-17 21:41:09 +01:00
void* memset(void* dst, int ch, UINT64 count) __attribute__ ((used));
void* memcpy(void* dst, const void* src, UINT64 count) __attribute__ ((used));
void* memset(void* dst, int ch, UINT64 count)
{
SetMem(dst, count, (UINT8)(ch));
return dst;
}
void* memcpy(void* dst, const void* src, UINT64 count)
{
CopyMem(dst, src, count);
return dst;
}
2020-02-21 10:44:15 +01:00
#endif
2020-02-17 21:41:09 +01:00
} // extern "C"
CONST CHAR16 *
EFIAPI
ConstStrStr (
IN CONST CHAR16 *String,
IN CONST CHAR16 *SearchString
)
{
return StrStr((CHAR16*)String, SearchString);
}