summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/global/qendian.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/corelib/global/qendian.h b/src/corelib/global/qendian.h
index c9c4d23aab..9b939feea0 100644
--- a/src/corelib/global/qendian.h
+++ b/src/corelib/global/qendian.h
@@ -78,7 +78,10 @@ template <typename T> inline void qbswap(const T src, uchar *dest)
// If you want to avoid the memcopy, you must write specializations for this function
template <typename T> inline void qToUnaligned(const T src, uchar *dest)
{
- memcpy(dest, &src, sizeof(T));
+ // Using sizeof(T) inside memcpy function produces internal compiler error with
+ // MSVC2008/ARM in tst_endian -> use extra indirection to resolve size of T.
+ const size_t size = sizeof(T);
+ memcpy(dest, &src, size);
}
/* T qFromLittleEndian(const uchar *src)