# HG changeset patch # User eldar_ins@eldar-laptop # Date 1260667495 -18000 # Node ID 04b52676b45f1fce83ae60e03976b15f2663428d # Parent 98b211f3ee34430dd12945c8f2e8dd50828821b2 fixed compiling all packages diff -r 98b211f3ee34 -r 04b52676b45f generator/abstractmetalang.h --- a/generator/abstractmetalang.h Sat Dec 12 16:01:55 2009 +0500 +++ b/generator/abstractmetalang.h Sun Dec 13 06:24:55 2009 +0500 @@ -846,6 +846,7 @@ bool isTypeAlias() const { return m_is_type_alias; } const QStringList &depends() { return m_type_entry->depends(); } + AbstractMetaFunctionList allFunctions() const { return m_functions; } bool needsConversionFunc; private: diff -r 98b211f3ee34 -r 04b52676b45f generator/cppimplgenerator.cpp --- a/generator/cppimplgenerator.cpp Sat Dec 12 16:01:55 2009 +0500 +++ b/generator/cppimplgenerator.cpp Sun Dec 13 06:24:55 2009 +0500 @@ -721,6 +721,7 @@ if (java_class->typeEntry()->isValue()) { + if (!java_class->typeEntry()->hasPrivateCopyConstructor()) // can do a copy if we have a public ctor or don't have any { QString argName = "orig"; s << endl << endl diff -r 98b211f3ee34 -r 04b52676b45f generator/dgenerator.cpp --- a/generator/dgenerator.cpp Sat Dec 12 16:01:55 2009 +0500 +++ b/generator/dgenerator.cpp Sun Dec 13 06:24:55 2009 +0500 @@ -2287,6 +2287,8 @@ // construction of a native copy of a Value if (d_class->typeEntry()->isValue()) { + AbstractMetaFunction *copy_ctor = d_class->copyConstructor(); + if (!d_class->typeEntry()->hasPrivateCopyConstructor()) // can do a copy if we have a public ctor or don't have any s << INDENT << "static void* __constructNativeCopy(const void* orig) {" << endl << INDENT << " return qtd_" << d_class->name() << "_native_copy(orig);" << endl << INDENT << "}" << endl << endl @@ -2470,6 +2472,8 @@ if (d_class->typeEntry()->isValue()) { + AbstractMetaFunction *copy_ctor = d_class->copyConstructor(); + if (!d_class->typeEntry()->hasPrivateCopyConstructor()) // can do a copy if we have a public ctor or don't have any { s << "private extern(C) void qtd_" << d_class->name() << "_placed_copy(const void* orig, void* place);" << endl << "private extern(C) void* qtd_" << d_class->name() << "_native_copy(const void* orig);" << endl; diff -r 98b211f3ee34 -r 04b52676b45f generator/typesystem.cpp --- a/generator/typesystem.cpp Sat Dec 12 16:01:55 2009 +0500 +++ b/generator/typesystem.cpp Sun Dec 13 06:24:55 2009 +0500 @@ -96,6 +96,7 @@ // qtd stuff AddClass = 0x1100, PackageDepend = 0x1200, + PrivateCopyConstructor = 0x1300, // Code snip tags (0x1000, 0x2000, ... , 0xf000) InjectCode = 0x1000, @@ -163,6 +164,7 @@ tagNames["rename"] = StackElement::Rename; tagNames["typesystem"] = StackElement::Root; tagNames["custom-constructor"] = StackElement::CustomMetaConstructor; + tagNames["private-copy-constructor"] = StackElement::PrivateCopyConstructor; tagNames["custom-destructor"] = StackElement::CustomMetaDestructor; tagNames["argument-map"] = StackElement::ArgumentMap; tagNames["suppress-warning"] = StackElement::SuppressedWarning; @@ -299,6 +301,11 @@ delete current->value.customFunction; } break; + case StackElement::PrivateCopyConstructor: + { + current->entry->setHasPrivateCopyConstructor(true); + } + break; case StackElement::CustomMetaDestructor: { current->entry->setCustomDestructor(*current->value.customFunction); diff -r 98b211f3ee34 -r 04b52676b45f generator/typesystem.h --- a/generator/typesystem.h Sat Dec 12 16:01:55 2009 +0500 +++ b/generator/typesystem.h Sun Dec 13 06:24:55 2009 +0500 @@ -436,9 +436,10 @@ : m_name(name), m_type(t), m_code_generation(GenerateAll), - m_preferred_conversion(true) + m_preferred_conversion(true), + m_has_copy_constructor(false) { - }; + } virtual ~TypeEntry() { } @@ -508,6 +509,8 @@ // qtd virtual bool isStructInD() const { return false; } + bool hasPrivateCopyConstructor() const { return m_has_copy_constructor; } + void setHasPrivateCopyConstructor(bool has_copy_constructor) { m_has_copy_constructor = has_copy_constructor; } private: QString m_name; @@ -516,6 +519,7 @@ CustomFunction m_customConstructor; CustomFunction m_customDestructor; bool m_preferred_conversion; + bool m_has_copy_constructor; }; typedef QHash > TypeEntryHash; typedef QHash SingleTypeEntryHash; diff -r 98b211f3ee34 -r 04b52676b45f generator/typesystem_network.xml --- a/generator/typesystem_network.xml Sat Dec 12 16:01:55 2009 +0500 +++ b/generator/typesystem_network.xml Sun Dec 13 06:24:55 2009 +0500 @@ -102,7 +102,7 @@ - + diff -r 98b211f3ee34 -r 04b52676b45f generator/typesystem_xml.xml --- a/generator/typesystem_xml.xml Sat Dec 12 16:01:55 2009 +0500 +++ b/generator/typesystem_xml.xml Sun Dec 13 06:24:55 2009 +0500 @@ -346,6 +346,7 @@ +