+
+ // ANI files are always little endian so we need to swap bytes on big
+ // endian architectures
+#ifdef WORDS_BIGENDIAN
+ void AdjustEndianness()
+ {
+ // this works because all our fields are wxInt32 and they must be
+ // packed without holes between them (if they're not, they wouldn't map
+ // to the file header!)
+ wxInt32 * const start = (wxInt32 *)this;
+ wxInt32 * const end = start + sizeof(wxANIHeader)/sizeof(wxInt32);
+ for ( wxInt32 *p = start; p != end; p++ )
+ {
+ *p = wxINT32_SWAP_ALWAYS(*p);
+ }
+ }
+#else
+ void AdjustEndianness() { }
+#endif