[10601] Amother attemp fix locale structures corruption.

Possible real source of problem: existing in code mixed
std:: structure templates instanting under pack pragma and out.
And this incompatible structure layouts wrongly mixed used by GCC.

So all std:: strcutures used moved out from pack pragma guards.
This commit is contained in:
VladimirMangos 2010-10-10 23:11:07 +04:00
parent 2fe45365c0
commit 0236699b0a
6 changed files with 50 additions and 52 deletions

View file

@ -161,23 +161,6 @@ struct CreatureInfo
} }
}; };
struct CreatureLocale
{
std::vector<std::string> Name;
std::vector<std::string> SubName;
};
struct GossipMenuItemsLocale
{
std::vector<std::string> OptionText;
std::vector<std::string> BoxText;
};
struct PointOfInterestLocale
{
std::vector<std::string> IconName;
};
struct EquipmentInfo struct EquipmentInfo
{ {
uint32 entry; uint32 entry;
@ -242,6 +225,30 @@ struct CreatureModelRace
uint32 modelid_racial; // Explicit modelid. Used if creature_template entry is not defined uint32 modelid_racial; // Explicit modelid. Used if creature_template entry is not defined
}; };
// 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__ )
#pragma pack()
#else
#pragma pack(pop)
#endif
struct CreatureLocale
{
std::vector<std::string> Name;
std::vector<std::string> SubName;
};
struct GossipMenuItemsLocale
{
std::vector<std::string> OptionText;
std::vector<std::string> BoxText;
};
struct PointOfInterestLocale
{
std::vector<std::string> IconName;
};
enum InhabitTypeValues enum InhabitTypeValues
{ {
INHABIT_GROUND = 1, INHABIT_GROUND = 1,
@ -275,13 +282,6 @@ enum AttackingTarget
*/ */
}; };
// 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__ )
#pragma pack()
#else
#pragma pack(pop)
#endif
// Vendors // Vendors
struct VendorItem struct VendorItem
{ {

View file

@ -1501,11 +1501,6 @@ struct SpellEntry
SpellEntry(SpellEntry const&); // DON'T must have implementation SpellEntry(SpellEntry const&); // DON'T must have implementation
}; };
typedef std::set<uint32> SpellCategorySet;
typedef std::map<uint32,SpellCategorySet > SpellCategoryStore;
typedef std::set<uint32> PetFamilySpellsSet;
typedef std::map<uint32,PetFamilySpellsSet > PetFamilySpellsStore;
struct SpellCastTimesEntry struct SpellCastTimesEntry
{ {
uint32 ID; // 0 uint32 ID; // 0
@ -1856,6 +1851,11 @@ struct WorldSafeLocsEntry
#pragma pack(pop) #pragma pack(pop)
#endif #endif
typedef std::set<uint32> SpellCategorySet;
typedef std::map<uint32,SpellCategorySet > SpellCategoryStore;
typedef std::set<uint32> PetFamilySpellsSet;
typedef std::map<uint32,PetFamilySpellsSet > PetFamilySpellsStore;
// Structures not used for casting to loaded DBC data and not required then packing // Structures not used for casting to loaded DBC data and not required then packing
struct MapDifficulty struct MapDifficulty
{ {

View file

@ -516,13 +516,6 @@ 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()
@ -530,6 +523,12 @@ struct GameObjectLocale
#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,17 +656,17 @@ 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
{
std::vector<std::string> Name;
std::vector<std::string> Description;
};
// 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()
#else #else
#pragma pack(pop) #pragma pack(pop)
#endif #endif
struct ItemLocale
{
std::vector<std::string> Name;
std::vector<std::string> Description;
};
#endif #endif

View file

@ -34,7 +34,13 @@ struct PageText
uint32 Next_Page; uint32 Next_Page;
}; };
// By unknown reason GCC generate wrong code for locale structures declared in header after pack pragma // 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__ )
#pragma pack()
#else
#pragma pack(pop)
#endif
struct PageTextLocale struct PageTextLocale
{ {
std::vector<std::string> Text; std::vector<std::string> Text;
@ -48,13 +54,6 @@ struct NpcTextLocale
std::vector<std::vector<std::string> > Text_1; 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
#if defined( __GNUC__ )
#pragma pack()
#else
#pragma pack(pop)
#endif
struct QEmote struct QEmote
{ {
uint32 _Emote; uint32 _Emote;

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 "10600" #define REVISION_NR "10601"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__