diff --git a/source/linux/wwrapper.h b/source/linux/wwrapper.h index e92ec6f3..97e3e2dd 100644 --- a/source/linux/wwrapper.h +++ b/source/linux/wwrapper.h @@ -65,7 +65,14 @@ #define FillMemory(Destination,Length,Fill) memset((Destination),(Fill),(Length)) #define EqualMemory(Destination,Source,Length) (!memcmp((Destination),(Source),(Length))) #define CopyMemory(Destination,Source,Length) memcpy((Destination),(Source),(Length)) -#define ZeroMemory(Destination,Length) memset((Destination),0,(Length)) + +template +void ZeroMemory(T * dest, const size_t size) +{ + // never zero a C++ complex type requiring a constructor call. + static_assert(std::is_pod::value || std::is_void::value, "POD required for ZeroMemory()"); + memset(dest, 0, size); +} void _tzset(); errno_t ctime_s(char * buf, size_t size, const time_t *time);