Cleared "Types cannot be declared in anonymous union" (Issue 274)
Thanks to Martin Bonner at http://stackoverflow.com/a/39507183pull/280/head
parent
34c1837647
commit
f2e5149319
18
integer.cpp
18
integer.cpp
|
|
@ -317,12 +317,10 @@ public:
|
||||||
word GetHighHalfAsBorrow() const {return 0-m_halfs.high;}
|
word GetHighHalfAsBorrow() const {return 0-m_halfs.high;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
union
|
// Issue 274, "Types cannot be declared in anonymous union",
|
||||||
{
|
// http://github.com/weidai11/cryptopp/issues/274
|
||||||
#ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE
|
// Thanks to Martin Bonner at http://stackoverflow.com/a/39507183
|
||||||
dword m_whole;
|
struct half_words
|
||||||
#endif
|
|
||||||
struct
|
|
||||||
{
|
{
|
||||||
#ifdef IS_LITTLE_ENDIAN
|
#ifdef IS_LITTLE_ENDIAN
|
||||||
word low;
|
word low;
|
||||||
|
|
@ -331,7 +329,13 @@ private:
|
||||||
word high;
|
word high;
|
||||||
word low;
|
word low;
|
||||||
#endif
|
#endif
|
||||||
} m_halfs;
|
};
|
||||||
|
union
|
||||||
|
{
|
||||||
|
#ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE
|
||||||
|
dword m_whole;
|
||||||
|
#endif
|
||||||
|
half_words m_halfs;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue