From 8d89e85cfe625d69fade8ba3a97415dd7dd44ca8 Mon Sep 17 00:00:00 2001 From: Jeff Walden Date: Mon, 2 Jan 2012 16:34:25 -0600 Subject: [PATCH] Bug 714264 - Move declarations around such that it's possible to include jsprvtd.h before Vector.h or HashTable.h. r=luke --HG-- extra : rebase_source : e981944be5edf5c772df986d0898494b9bc53a3e --- js/public/HashTable.h | 9 +++++++-- js/public/Vector.h | 6 +++++- js/src/jsprvtd.h | 25 +++++-------------------- 3 files changed, 17 insertions(+), 23 deletions(-) diff --git a/js/public/HashTable.h b/js/public/HashTable.h index a9d7d7dc2c7a..040c325458de 100644 --- a/js/public/HashTable.h +++ b/js/public/HashTable.h @@ -48,6 +48,8 @@ namespace js { +class TempAllocPolicy; + /* Integral types for all hash functions. */ typedef uint32_t HashNumber; @@ -958,7 +960,10 @@ struct IsPodType > * called by HashMap must not call back into the same HashMap object. * N.B: Due to the lack of exception handling, the user must call |init()|. */ -template +template , + class AllocPolicy = TempAllocPolicy> class HashMap { public: @@ -1200,7 +1205,7 @@ class HashMap * HashSet must not call back into the same HashSet object. * N.B: Due to the lack of exception handling, the user must call |init()|. */ -template +template , class AllocPolicy = TempAllocPolicy> class HashSet { typedef typename HashPolicy::Lookup Lookup; diff --git a/js/public/Vector.h b/js/public/Vector.h index cbfedab7223d..2dac1f883de3 100644 --- a/js/public/Vector.h +++ b/js/public/Vector.h @@ -54,7 +54,11 @@ namespace js { -template +class TempAllocPolicy; + +template class Vector; /* diff --git a/js/src/jsprvtd.h b/js/src/jsprvtd.h index 21c7a444014b..662061e24a1b 100644 --- a/js/src/jsprvtd.h +++ b/js/src/jsprvtd.h @@ -55,9 +55,13 @@ */ #include "jsapi.h" - #include "jsutil.h" +#ifdef __cplusplus +#include "js/HashTable.h" +#include "js/Vector.h" +#endif + JS_BEGIN_EXTERN_C /* @@ -188,25 +192,6 @@ class RuntimeAllocPolicy; class GlobalObject; -template -class Vector; - -template -struct DefaultHasher; - -template , - class AllocPolicy = TempAllocPolicy> -class HashMap; - -template , - class AllocPolicy = TempAllocPolicy> -class HashSet; - template