From: Mikko Rasa Date: Sun, 8 Jan 2023 12:55:14 +0000 (+0200) Subject: Prefix C++ types with namespaces in the setup generator X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=c7174843c35e0f1f8f2d6e2d4cdbb386f2a82361;p=libs%2Fgame.git Prefix C++ types with namespaces in the setup generator --- diff --git a/tools/setupgen/setupgen.cpp b/tools/setupgen/setupgen.cpp index 571396f..efb93fb 100644 --- a/tools/setupgen/setupgen.cpp +++ b/tools/setupgen/setupgen.cpp @@ -208,6 +208,7 @@ void SetupGen::Loader::enum_def(const DataFile::Symbol &n) Enum en(n.name); load_sub(en); Type &type = obj.add_type(n.name, Type::ENUM); + type.set_cpp_type(join(mod.name_space, "::", type.get_cpp_type())); type.set_enum(*mod.enums.emplace_back(make_unique(move(en)))); } @@ -235,5 +236,6 @@ void SetupGen::Loader::struct_def(Struct::Kind kind, const DataFile::Symbol &n) Struct sct(n.name+"Setup", kind); load_sub(sct, obj); Type &type = obj.add_type(n.name, Type::STRUCT); + type.set_cpp_type(join(mod.name_space, "::", type.get_cpp_type())); type.set_struct(*mod.structs.emplace_back(make_unique(move(sct)))); }