[10599] Attempt fix data corruption for some localization structures with GCC use.

By unknown reason GCC generate wrong code for locale structures declared in header after pack pragma.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
cyberbrest2 2010-10-09 22:39:19 +04:00 committed by VladimirMangos
parent ba3578107a
commit 0205adfde1
4 changed files with 23 additions and 19 deletions

View file

@ -516,6 +516,13 @@ struct GameObjectInfo
} }
}; };
// By unknown reason GCC generate wrong code for locale structures declared in header after pack pragma
struct GameObjectLocale
{
std::vector<std::string> Name;
std::vector<std::string> CastBarCaption;
};
// GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform // GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform
#if defined( __GNUC__ ) #if defined( __GNUC__ )
#pragma pack() #pragma pack()
@ -523,12 +530,6 @@ struct GameObjectInfo
#pragma pack(pop) #pragma pack(pop)
#endif #endif
struct GameObjectLocale
{
std::vector<std::string> Name;
std::vector<std::string> CastBarCaption;
};
// client side GO show states // client side GO show states
enum GOState enum GOState
{ {

View file

@ -656,6 +656,7 @@ struct ItemPrototype
bool IsConjuredConsumable() const { return Class == ITEM_CLASS_CONSUMABLE && (Flags & ITEM_FLAGS_CONJURED); } bool IsConjuredConsumable() const { return Class == ITEM_CLASS_CONSUMABLE && (Flags & ITEM_FLAGS_CONJURED); }
}; };
// By unknown reason GCC generate wrong code for locale structures declared in header after pack pragma
struct ItemLocale struct ItemLocale
{ {
std::vector<std::string> Name; std::vector<std::string> Name;

View file

@ -34,6 +34,20 @@ struct PageText
uint32 Next_Page; uint32 Next_Page;
}; };
// By unknown reason GCC generate wrong code for locale structures declared in header after pack pragma
struct PageTextLocale
{
std::vector<std::string> Text;
};
struct NpcTextLocale
{
NpcTextLocale() { Text_0.resize(8); Text_1.resize(8); }
std::vector<std::vector<std::string> > Text_0;
std::vector<std::vector<std::string> > Text_1;
};
// GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform // GCC have alternative #pragma pack() syntax and old gcc version not support pack(pop), also any gcc version not support it at some platform
#if defined( __GNUC__ ) #if defined( __GNUC__ )
#pragma pack() #pragma pack()
@ -61,16 +75,4 @@ struct GossipText
GossipTextOption Options[8]; GossipTextOption Options[8];
}; };
struct PageTextLocale
{
std::vector<std::string> Text;
};
struct NpcTextLocale
{
NpcTextLocale() { Text_0.resize(8); Text_1.resize(8); }
std::vector<std::vector<std::string> > Text_0;
std::vector<std::vector<std::string> > Text_1;
};
#endif #endif

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "10598" #define REVISION_NR "10599"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__