diff --git a/xpcom/ds/nsStaticAtom.h b/xpcom/ds/nsStaticAtom.h index 2bf96531d20..c0b44db804c 100644 --- a/xpcom/ds/nsStaticAtom.h +++ b/xpcom/ds/nsStaticAtom.h @@ -11,10 +11,12 @@ #include "nsStringBuffer.h" #include "mozilla/Logging.h" -typedef char16_t nsStaticAtomStringType; +#define NS_STATIC_ATOM(buffer_name, atom_ptr) \ + { (nsStringBuffer*) &buffer_name, atom_ptr } -#define NS_STATIC_ATOM(buffer_name, atom_ptr) { (nsStringBuffer*) &buffer_name, atom_ptr } -#define NS_STATIC_ATOM_BUFFER(buffer_name, str_data) static nsFakeStringBuffer< sizeof(str_data) > buffer_name = { 1, sizeof(str_data) * sizeof(nsStaticAtomStringType), MOZ_UTF16(str_data) }; +#define NS_STATIC_ATOM_BUFFER(buffer_name, str_data) \ + static nsFakeStringBuffer buffer_name = \ + { 1, sizeof(str_data) * sizeof(char16_t), MOZ_UTF16(str_data) }; /** * Holds data used to initialize large number of atoms during startup. Use @@ -37,7 +39,7 @@ struct nsFakeStringBuffer { int32_t mRefCnt; uint32_t mSize; - nsStaticAtomStringType mStringData[size]; + char16_t mStringData[size]; }; // Register an array of static atoms with the atom table