浏览代码

Allow GDCLASS in own namespaces

The unqualified ClassDB friending was causing (at least for me on
VS2022) an implicit forward declaration of ClassDB in the namespace
of my class, instead of using the godot namespaced one. By qualifying
the namespace, this compiles for me.

Test-Information:
My project builds now.
Kevin Smith 3 年之前
父节点
当前提交
fd8173f109
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      include/godot_cpp/classes/wrapped.hpp

+ 1 - 1
include/godot_cpp/classes/wrapped.hpp

@@ -67,7 +67,7 @@ public:
 #define GDCLASS(m_class, m_inherits)                                                                               \
 private:                                                                                                           \
 	void operator=(const m_class &p_rval) {}                                                                       \
-	friend class ClassDB;                                                                                          \
+	friend class ::godot::ClassDB;                                                                                 \
                                                                                                                    \
 protected:                                                                                                         \
 	virtual const char *_get_extension_class() const override {                                                    \