I am building an EFI driver and therefore cannot use stdlib, so no memset. I am also running after ExitBootServices, so no edk2 CopyMem. This is my function:
void Set_Memory(VOID* Dest, UINTN Len, CHAR8 Val)
{
for (int i = 0; i < Len; ++i)
{
((UINT8*)Dest)[i] = Val;
}
}
When compiling with optimizations, I get LNK2001 unresolved external symbol memset
. Presumably the MSVC compiler is replacing my call to Set_Memory
with a call to memset
. I also cannot define my own memset
, because I get the error C2169 'memset': intrinsic function, cannot be defined
. How can I prevent this without losing other optimizations?