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
parent f4d80d28e6
commit 62d848316b
2 changed files with 14 additions and 10 deletions

View File

@ -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;
};
};

View File

@ -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;
};
};