fixing hpux bustage. unnamed unions can't access structs which are protected.

making FragmentBits a public struct, but the variable of this type is still
private.  The other solution would be to "name" the union and delcare
FragmentBits a friend of the union (the union has to be named to declare
friendship).
This commit is contained in:
jdunn%netscape.com 2001-12-10 15:43:18 +00:00
Родитель f4d80d28e6
Коммит 62d848316b
2 изменённых файлов: 14 добавлений и 10 удалений

Просмотреть файл

@ -218,6 +218,12 @@ public:
return mState.mIs2b ? m2b[aIndex] : PRUnichar(m1b[aIndex]);
}
struct FragmentBits {
PRBool mInHeap : 1;
PRBool mIs2b : 1;
PRUint32 mLength : 30;
};
protected:
void ReleaseText();
@ -228,11 +234,7 @@ protected:
union {
PRUint32 mAllBits;
struct {
PRBool mInHeap : 1;
PRBool mIs2b : 1;
PRUint32 mLength : 30;
} mState;
FragmentBits mState;
};
};

Просмотреть файл

@ -218,6 +218,12 @@ public:
return mState.mIs2b ? m2b[aIndex] : PRUnichar(m1b[aIndex]);
}
struct FragmentBits {
PRBool mInHeap : 1;
PRBool mIs2b : 1;
PRUint32 mLength : 30;
};
protected:
void ReleaseText();
@ -228,11 +234,7 @@ protected:
union {
PRUint32 mAllBits;
struct {
PRBool mInHeap : 1;
PRBool mIs2b : 1;
PRUint32 mLength : 30;
} mState;
FragmentBits mState;
};
};