Cleared "Types cannot be declared in anonymous union" (Issue 274)

Thanks to Martin Bonner at http://stackoverflow.com/a/39507183
pull/280/head
Jeffrey Walton 2016-09-15 09:38:40 -04:00
parent 34c1837647
commit f2e5149319
1 changed files with 20 additions and 16 deletions

View File

@ -317,22 +317,26 @@ 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
{ word low;
#ifdef IS_LITTLE_ENDIAN word high;
word low; #else
word high; word high;
#else word low;
word high; #endif
word low; };
#endif union
} m_halfs; {
}; #ifdef CRYPTOPP_NATIVE_DWORD_AVAILABLE
dword m_whole;
#endif
half_words m_halfs;
};
}; };
class Word class Word