From b4993b8d3ef164b9b387a200a6d228274aa5a94e Mon Sep 17 00:00:00 2001 From: Jeff Walden Date: Wed, 12 Oct 2011 11:42:55 -0700 Subject: [PATCH] Followup fix to ArrayLength stuff for bug 693469 -- ISO C++98 forbids templates declaring on local types. Boo-urns! r=red --HG-- extra : rebase_source : f0e398168239c0be1274079e8260ff363198beee --- xpcom/base/nsSystemInfo.cpp | 40 ++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/xpcom/base/nsSystemInfo.cpp b/xpcom/base/nsSystemInfo.cpp index 8822b26a1f9..ee9b40da04c 100644 --- a/xpcom/base/nsSystemInfo.cpp +++ b/xpcom/base/nsSystemInfo.cpp @@ -63,6 +63,26 @@ nsSystemInfo::~nsSystemInfo() { } +// CPU-specific information. +static const struct { + const char *name; + bool (*propfun)(void); +} cpuPropItems[] = { + // x86-specific bits. + { "hasMMX", mozilla::supports_mmx }, + { "hasSSE", mozilla::supports_sse }, + { "hasSSE2", mozilla::supports_sse2 }, + { "hasSSE3", mozilla::supports_sse3 }, + { "hasSSSE3", mozilla::supports_ssse3 }, + { "hasSSE4A", mozilla::supports_sse4a }, + { "hasSSE4_1", mozilla::supports_sse4_1 }, + { "hasSSE4_2", mozilla::supports_sse4_2 }, + // ARM-specific bits. + { "hasEDSP", mozilla::supports_edsp }, + { "hasARMv6", mozilla::supports_armv6 }, + { "hasNEON", mozilla::supports_neon } +}; + nsresult nsSystemInfo::Init() { @@ -98,26 +118,6 @@ nsSystemInfo::Init() SetInt32Property(NS_LITERAL_STRING("cpucount"), PR_GetNumberOfProcessors()); SetUint64Property(NS_LITERAL_STRING("memsize"), PR_GetPhysicalMemorySize()); - // CPU-specific information. - static const struct { - const char *name; - bool (*propfun)(void); - } cpuPropItems[] = { - // x86-specific bits. - { "hasMMX", mozilla::supports_mmx }, - { "hasSSE", mozilla::supports_sse }, - { "hasSSE2", mozilla::supports_sse2 }, - { "hasSSE3", mozilla::supports_sse3 }, - { "hasSSSE3", mozilla::supports_ssse3 }, - { "hasSSE4A", mozilla::supports_sse4a }, - { "hasSSE4_1", mozilla::supports_sse4_1 }, - { "hasSSE4_2", mozilla::supports_sse4_2 }, - // ARM-specific bits. - { "hasEDSP", mozilla::supports_edsp }, - { "hasARMv6", mozilla::supports_armv6 }, - { "hasNEON", mozilla::supports_neon } - }; - for (PRUint32 i = 0; i < ArrayLength(cpuPropItems); i++) { rv = SetPropertyAsBool(NS_ConvertASCIItoUTF16(cpuPropItems[i].name), cpuPropItems[i].propfun());