Commit 0e5478c3 authored by Chun-wei Fan's avatar Chun-wei Fan Committed by Philip Chimento

gi/*.h: Be clear about the templates used with friend classes

Some compilers (such as Visual Studio) want us to be clear about the
templates that we use for the templatized friend classes of the
various (templatized) classes that we use.  This makes those friend
classes clear about the templates.

See: https://stackoverflow.com/questions/54754742/non-class-template-has-already-been-declared-as-a-class-template
parent 64a88b75
......@@ -55,7 +55,7 @@ class BoxedInstance;
class BoxedBase
: public GIWrapperBase<BoxedBase, BoxedPrototype, BoxedInstance> {
friend class GIWrapperBase;
friend class GIWrapperBase<BoxedBase, BoxedPrototype, BoxedInstance>;
protected:
explicit BoxedBase(BoxedPrototype* proto = nullptr)
......@@ -89,8 +89,9 @@ class BoxedBase
class BoxedPrototype : public GIWrapperPrototype<BoxedBase, BoxedPrototype,
BoxedInstance, GIStructInfo> {
friend class GIWrapperPrototype;
friend class GIWrapperBase;
friend class GIWrapperPrototype<BoxedBase, BoxedPrototype, BoxedInstance,
GIStructInfo>;
friend class GIWrapperBase<BoxedBase, BoxedPrototype, BoxedInstance>;
using FieldMap =
JS::GCHashMap<JS::Heap<JSString*>, GjsAutoFieldInfo,
......@@ -155,8 +156,8 @@ class BoxedPrototype : public GIWrapperPrototype<BoxedBase, BoxedPrototype,
class BoxedInstance
: public GIWrapperInstance<BoxedBase, BoxedPrototype, BoxedInstance> {
friend class GIWrapperInstance;
friend class GIWrapperBase;
friend class GIWrapperInstance<BoxedBase, BoxedPrototype, BoxedInstance>;
friend class GIWrapperBase<BoxedBase, BoxedPrototype, BoxedInstance>;
friend class BoxedBase; // for field_getter, etc.
bool m_allocated_directly : 1;
......
......@@ -45,7 +45,8 @@ class FundamentalInstance;
class FundamentalBase
: public GIWrapperBase<FundamentalBase, FundamentalPrototype,
FundamentalInstance> {
friend class GIWrapperBase;
friend class GIWrapperBase<FundamentalBase, FundamentalPrototype,
FundamentalInstance>;
protected:
explicit FundamentalBase(FundamentalPrototype* proto = nullptr)
......@@ -66,8 +67,10 @@ class FundamentalBase
class FundamentalPrototype
: public GIWrapperPrototype<FundamentalBase, FundamentalPrototype,
FundamentalInstance> {
friend class GIWrapperPrototype;
friend class GIWrapperBase;
friend class GIWrapperPrototype<FundamentalBase, FundamentalPrototype,
FundamentalInstance>;
friend class GIWrapperBase<FundamentalBase, FundamentalPrototype,
FundamentalInstance>;
GIObjectInfoRefFunction m_ref_function;
GIObjectInfoUnrefFunction m_unref_function;
......@@ -122,8 +125,10 @@ class FundamentalPrototype
class FundamentalInstance
: public GIWrapperInstance<FundamentalBase, FundamentalPrototype,
FundamentalInstance> {
friend class GIWrapperInstance;
friend class GIWrapperBase;
friend class GIWrapperInstance<FundamentalBase, FundamentalPrototype,
FundamentalInstance>;
friend class GIWrapperBase<FundamentalBase, FundamentalPrototype,
FundamentalInstance>;
explicit FundamentalInstance(JSContext* cx, JS::HandleObject obj);
~FundamentalInstance(void);
......
......@@ -51,7 +51,7 @@ class ErrorInstance;
class ErrorBase
: public GIWrapperBase<ErrorBase, ErrorPrototype, ErrorInstance> {
friend class GIWrapperBase;
friend class GIWrapperBase<ErrorBase, ErrorPrototype, ErrorInstance>;
protected:
explicit ErrorBase(ErrorPrototype* proto = nullptr)
......@@ -93,8 +93,9 @@ class ErrorBase
class ErrorPrototype : public GIWrapperPrototype<ErrorBase, ErrorPrototype,
ErrorInstance, GIEnumInfo> {
friend class GIWrapperPrototype;
friend class GIWrapperBase;
friend class GIWrapperPrototype<ErrorBase, ErrorPrototype, ErrorInstance,
GIEnumInfo>;
friend class GIWrapperBase<ErrorBase, ErrorPrototype, ErrorInstance>;
GQuark m_domain;
......@@ -110,8 +111,9 @@ class ErrorPrototype : public GIWrapperPrototype<ErrorBase, ErrorPrototype,
class ErrorInstance : public GIWrapperInstance<ErrorBase, ErrorPrototype,
ErrorInstance, GError> {
friend class GIWrapperInstance;
friend class GIWrapperBase;
friend class GIWrapperInstance<ErrorBase, ErrorPrototype, ErrorInstance,
GError>;
friend class GIWrapperBase<ErrorBase, ErrorPrototype, ErrorInstance>;
explicit ErrorInstance(JSContext* cx, JS::HandleObject obj);
~ErrorInstance(void);
......
......@@ -50,7 +50,8 @@ class InterfaceInstance;
class InterfaceBase : public GIWrapperBase<InterfaceBase, InterfacePrototype,
InterfaceInstance> {
friend class GIWrapperBase;
friend class GIWrapperBase<InterfaceBase, InterfacePrototype,
InterfaceInstance>;
protected:
explicit InterfaceBase(InterfacePrototype* proto = nullptr)
......@@ -83,8 +84,10 @@ class InterfaceBase : public GIWrapperBase<InterfaceBase, InterfacePrototype,
class InterfacePrototype
: public GIWrapperPrototype<InterfaceBase, InterfacePrototype,
InterfaceInstance, GIInterfaceInfo> {
friend class GIWrapperPrototype;
friend class GIWrapperBase;
friend class GIWrapperPrototype<InterfaceBase, InterfacePrototype,
InterfaceInstance, GIInterfaceInfo>;
friend class GIWrapperBase<InterfaceBase, InterfacePrototype,
InterfaceInstance>;
friend class InterfaceBase; // for has_instance_impl
// the GTypeInterface vtable wrapped by this JS object
......@@ -108,8 +111,10 @@ class InterfacePrototype
class InterfaceInstance
: public GIWrapperInstance<InterfaceBase, InterfacePrototype,
InterfaceInstance> {
friend class GIWrapperInstance;
friend class GIWrapperBase;
friend class GIWrapperInstance<InterfaceBase, InterfacePrototype,
InterfaceInstance>;
friend class GIWrapperBase<InterfaceBase, InterfacePrototype,
InterfaceInstance>;
G_GNUC_NORETURN InterfaceInstance(JSContext* cx, JS::HandleObject obj)
: GIWrapperInstance(cx, obj) {
......
......@@ -79,7 +79,7 @@ class ObjectPrototype;
*/
class ObjectBase
: public GIWrapperBase<ObjectBase, ObjectPrototype, ObjectInstance> {
friend class GIWrapperBase;
friend class GIWrapperBase<ObjectBase, ObjectPrototype, ObjectInstance>;
protected:
/* a list of all GClosures installed on this object (from
......@@ -167,8 +167,9 @@ class ObjectBase
class ObjectPrototype
: public GIWrapperPrototype<ObjectBase, ObjectPrototype, ObjectInstance> {
friend class GIWrapperPrototype;
friend class GIWrapperBase;
friend class GIWrapperPrototype<ObjectBase, ObjectPrototype,
ObjectInstance>;
friend class GIWrapperBase<ObjectBase, ObjectPrototype, ObjectInstance>;
using PropertyCache =
JS::GCHashMap<JS::Heap<JSString*>, GjsAutoParam,
......@@ -250,8 +251,9 @@ class ObjectPrototype
class ObjectInstance : public GIWrapperInstance<ObjectBase, ObjectPrototype,
ObjectInstance, GObject> {
friend class GIWrapperInstance;
friend class GIWrapperBase;
friend class GIWrapperInstance<ObjectBase, ObjectPrototype, ObjectInstance,
GObject>;
friend class GIWrapperBase<ObjectBase, ObjectPrototype, ObjectInstance>;
friend class ObjectBase; // for add_property, prop_getter, etc.
// GIWrapperInstance::m_ptr may be null in ObjectInstance.
......
......@@ -37,7 +37,7 @@ class UnionInstance;
class UnionBase
: public GIWrapperBase<UnionBase, UnionPrototype, UnionInstance> {
friend class GIWrapperBase;
friend class GIWrapperBase<UnionBase, UnionPrototype, UnionInstance>;
protected:
explicit UnionBase(UnionPrototype* proto = nullptr)
......@@ -55,8 +55,9 @@ class UnionBase
class UnionPrototype : public GIWrapperPrototype<UnionBase, UnionPrototype,
UnionInstance, GIUnionInfo> {
friend class GIWrapperPrototype;
friend class GIWrapperBase;
friend class GIWrapperPrototype<UnionBase, UnionPrototype, UnionInstance,
GIUnionInfo>;
friend class GIWrapperBase<UnionBase, UnionPrototype, UnionInstance>;
explicit UnionPrototype(GIUnionInfo* info, GType gtype);
~UnionPrototype(void);
......@@ -71,8 +72,8 @@ class UnionPrototype : public GIWrapperPrototype<UnionBase, UnionPrototype,
class UnionInstance
: public GIWrapperInstance<UnionBase, UnionPrototype, UnionInstance> {
friend class GIWrapperInstance;
friend class GIWrapperBase;
friend class GIWrapperInstance<UnionBase, UnionPrototype, UnionInstance>;
friend class GIWrapperBase<UnionBase, UnionPrototype, UnionInstance>;
explicit UnionInstance(JSContext* cx, JS::HandleObject obj);
~UnionInstance(void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment