diff --git a/src/hash.h b/src/hash.h index 3d02ab9b..a89aa9b4 100644 --- a/src/hash.h +++ b/src/hash.h @@ -32,6 +32,7 @@ SOFTWARE. #define __ETL_HASH__ #include +#include // The default hash calculation. #include "fnv_1.h" @@ -322,7 +323,9 @@ namespace etl { if (sizeof(size_t) == sizeof(v)) { - return *reinterpret_cast(&v); + size_t t; + memcpy(&t, &v, sizeof(size_t)); + return t; } else { @@ -344,7 +347,9 @@ namespace etl { if (sizeof(size_t) == sizeof(v)) { - return *reinterpret_cast(&v); + size_t t; + memcpy(&t, &v, sizeof(size_t)); + return t; } else { @@ -366,7 +371,9 @@ namespace etl { if (sizeof(size_t) == sizeof(v)) { - return *reinterpret_cast(&v); + size_t t; + memcpy(&t, &v, sizeof(size_t)); + return t; } else { @@ -387,7 +394,9 @@ namespace etl { if (sizeof(size_t) == sizeof(T*)) { - return reinterpret_cast(v); + size_t t; + memcpy(&t, &v, sizeof(size_t)); + return t; } else {