Mercurial > projects > qtd
comparison generator/cppimplgenerator.cpp @ 384:d2f48c4cb3e3
Same behavior of shared libs on linux and windows. Minor build script fixes.
author | Max Samukha <maxter@spambox.com> |
---|---|
date | Fri, 16 Jul 2010 20:04:29 +0300 |
parents | 1d56b2a2e10c |
children | 7dddafad5a20 |
comparison
equal
deleted
inserted
replaced
383:bd7f485e3573 | 384:d2f48c4cb3e3 |
---|---|
37 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 37 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
38 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 38 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
39 ** | 39 ** |
40 ****************************************************************************/ | 40 ****************************************************************************/ |
41 | 41 |
42 #include "global.h" | |
42 #include "cppimplgenerator.h" | 43 #include "cppimplgenerator.h" |
43 #include "dgenerator.h" | 44 #include "dgenerator.h" |
44 #include "reporthandler.h" | 45 #include "reporthandler.h" |
45 | 46 |
46 #include <QDir> | 47 #include <QDir> |
382 uint options = CppImplGenerator::StandardJNISignature) | 383 uint options = CppImplGenerator::StandardJNISignature) |
383 { | 384 { |
384 QString s; | 385 QString s; |
385 | 386 |
386 if (options & CppImplGenerator::ExternC) | 387 if (options & CppImplGenerator::ExternC) |
387 s += "QTD_EXTERN QTD_DLL_PUBLIC "; | 388 s += "QTD_EXTERN QTD_EXPORT "; |
388 /* qtd | 389 /* qtd |
389 if (options & CppImplGenerator::JNIExport) | 390 if (options & CppImplGenerator::JNIExport) |
390 s += "Q_DECL_EXPORT "; | 391 s += "Q_DECL_EXPORT "; |
391 */ | 392 */ |
392 if (options & CppImplGenerator::ReturnType) | 393 if (options & CppImplGenerator::ReturnType) |
478 | 479 |
479 // in case of renamed class | 480 // in case of renamed class |
480 InterfaceTypeEntry *ite = static_cast<InterfaceTypeEntry*>(iface->typeEntry()); | 481 InterfaceTypeEntry *ite = static_cast<InterfaceTypeEntry*>(iface->typeEntry()); |
481 QString real_name = ite->origin()->qualifiedCppName(); | 482 QString real_name = ite->origin()->qualifiedCppName(); |
482 | 483 |
483 s << "QTD_EXTERN QTD_DLL_PUBLIC " << real_name << "* qtd_" << java_class->name() << "_cast_to_" << iface->qualifiedCppName() | 484 s << "QTD_EXTERN QTD_EXPORT " << real_name << "* qtd_" << java_class->name() << "_cast_to_" << iface->qualifiedCppName() |
484 << "(" << java_class->qualifiedCppName() << " *ptr)" << endl << "{" << endl; | 485 << "(" << java_class->qualifiedCppName() << " *ptr)" << endl << "{" << endl; |
485 Indentation indent(INDENT); | 486 Indentation indent(INDENT); |
486 s << INDENT << "return dynamic_cast<" << real_name << "*>(ptr);" << endl; | 487 s << INDENT << "return dynamic_cast<" << real_name << "*>(ptr);" << endl; |
487 s << "}" << endl << endl; | 488 s << "}" << endl << endl; |
488 } | 489 } |
573 const AbstractMetaFunction *function = virtualFunctions.at(pos); | 574 const AbstractMetaFunction *function = virtualFunctions.at(pos); |
574 // qtd writeShellFunction(s, function, java_class, pos); | 575 // qtd writeShellFunction(s, function, java_class, pos); |
575 writeShellVirtualFunction(s, function, java_class, pos); | 576 writeShellVirtualFunction(s, function, java_class, pos); |
576 } | 577 } |
577 | 578 |
578 if (cpp_shared) | 579 if (global.cppShared) |
579 writeInitCallbacks(s, java_class); | 580 writeInitCallbacks(s, java_class); |
580 | 581 |
581 // Functions in shell class | 582 // Functions in shell class |
582 s << "// Functions in shell class" << endl; | 583 s << "// Functions in shell class" << endl; |
583 AbstractMetaFunctionList shellFunctions = java_class->nonVirtualShellFunctions(); | 584 AbstractMetaFunctionList shellFunctions = java_class->nonVirtualShellFunctions(); |
671 writeValueFunctions(s, java_class); | 672 writeValueFunctions(s, java_class); |
672 | 673 |
673 if (java_class->isQObject()) | 674 if (java_class->isQObject()) |
674 { | 675 { |
675 s << endl << endl | 676 s << endl << endl |
676 << "QTD_EXTERN QTD_DLL_PUBLIC void* qtd_" << java_class->name() << "_staticMetaObject() {" << endl | 677 << "QTD_EXTERN QTD_EXPORT void* qtd_" << java_class->name() << "_staticMetaObject() {" << endl |
677 << " return (void*)&" << java_class->name() << "::staticMetaObject;" << endl | 678 << " return (void*)&" << java_class->name() << "::staticMetaObject;" << endl |
678 << "}" << endl; | 679 << "}" << endl; |
679 } | 680 } |
680 | 681 |
681 if (java_class->typeEntry()->isValue()) | 682 if (java_class->typeEntry()->isValue()) |
682 { | 683 { |
683 if (!java_class->typeEntry()->hasPrivateCopyConstructor()) // can do a copy if we have a public ctor or don't have any | 684 if (!java_class->typeEntry()->hasPrivateCopyConstructor()) // can do a copy if we have a public ctor or don't have any |
684 { | 685 { |
685 QString argName = "orig"; | 686 QString argName = "orig"; |
686 s << endl << endl | 687 s << endl << endl |
687 << "QTD_EXTERN QTD_DLL_PUBLIC void qtd_" << java_class->name() << "_placed_copy(void* " | 688 << "QTD_EXTERN QTD_EXPORT void qtd_" << java_class->name() << "_placed_copy(void* " |
688 << argName << ", void* place) {" << endl | 689 << argName << ", void* place) {" << endl |
689 << QString(" const %1& __qt_%2 = (const %1& ) *(%1 *)%2;").arg(shellClassName(java_class)).arg(argName) << endl | 690 << QString(" const %1& __qt_%2 = (const %1& ) *(%1 *)%2;").arg(shellClassName(java_class)).arg(argName) << endl |
690 << QString(" %1 *result = new (place) %1 (__qt_%2);").arg(java_class->qualifiedCppName()).arg(argName) << endl; | 691 << QString(" %1 *result = new (place) %1 (__qt_%2);").arg(java_class->qualifiedCppName()).arg(argName) << endl; |
691 // writeFinalConstructor(s, ctor, "result", "original", "(place)"); | 692 // writeFinalConstructor(s, ctor, "result", "original", "(place)"); |
692 s << "}"; | 693 s << "}"; |
693 | 694 |
694 s << endl << endl | 695 s << endl << endl |
695 << "QTD_EXTERN QTD_DLL_PUBLIC void* qtd_" << java_class->name() << "_native_copy(void* " << argName << ") {" << endl | 696 << "QTD_EXTERN QTD_EXPORT void* qtd_" << java_class->name() << "_native_copy(void* " << argName << ") {" << endl |
696 << QString(" const %1& __qt_%2 = (const %1& ) *(%1 *)%2;").arg(shellClassName(java_class)).arg(argName) << endl | 697 << QString(" const %1& __qt_%2 = (const %1& ) *(%1 *)%2;").arg(shellClassName(java_class)).arg(argName) << endl |
697 << QString(" %1 *result = new %1 (__qt_%2);").arg(java_class->qualifiedCppName()).arg(argName) << endl | 698 << QString(" %1 *result = new %1 (__qt_%2);").arg(java_class->qualifiedCppName()).arg(argName) << endl |
698 << " return result;" << endl; | 699 << " return result;" << endl; |
699 s << "}"; | 700 s << "}"; |
700 } | 701 } |
705 priGenerator->addSource(java_class->package(), fileNameForClass(java_class)); | 706 priGenerator->addSource(java_class->package(), fileNameForClass(java_class)); |
706 } | 707 } |
707 | 708 |
708 void CppImplGenerator::writeValueFunctions(QTextStream &s, const AbstractMetaClass *java_class) | 709 void CppImplGenerator::writeValueFunctions(QTextStream &s, const AbstractMetaClass *java_class) |
709 { | 710 { |
710 s << QString("QTD_EXTERN QTD_DLL_PUBLIC bool qtd_%1_QTypeInfo_isComplex() { return (bool) QTypeInfo<%2>::isComplex; }\n").arg(java_class->name()).arg(java_class->qualifiedCppName()); | 711 s << QString("QTD_EXTERN QTD_EXPORT bool qtd_%1_QTypeInfo_isComplex() { return (bool) QTypeInfo<%2>::isComplex; }\n").arg(java_class->name()).arg(java_class->qualifiedCppName()); |
711 s << QString("QTD_EXTERN QTD_DLL_PUBLIC bool qtd_%1_QTypeInfo_isStatic() { return (bool) QTypeInfo<%2>::isStatic; }\n").arg(java_class->name()).arg(java_class->qualifiedCppName()); | 712 s << QString("QTD_EXTERN QTD_EXPORT bool qtd_%1_QTypeInfo_isStatic() { return (bool) QTypeInfo<%2>::isStatic; }\n").arg(java_class->name()).arg(java_class->qualifiedCppName()); |
712 s << QString("QTD_EXTERN QTD_DLL_PUBLIC bool qtd_%1_QTypeInfo_isLarge() { return (bool) QTypeInfo<%2>::isLarge; }\n").arg(java_class->name()).arg(java_class->qualifiedCppName()); | 713 s << QString("QTD_EXTERN QTD_EXPORT bool qtd_%1_QTypeInfo_isLarge() { return (bool) QTypeInfo<%2>::isLarge; }\n").arg(java_class->name()).arg(java_class->qualifiedCppName()); |
713 s << QString("QTD_EXTERN QTD_DLL_PUBLIC bool qtd_%1_QTypeInfo_isPointer() { return (bool) QTypeInfo<%2>::isPointer; }\n").arg(java_class->name()).arg(java_class->qualifiedCppName()); | 714 s << QString("QTD_EXTERN QTD_EXPORT bool qtd_%1_QTypeInfo_isPointer() { return (bool) QTypeInfo<%2>::isPointer; }\n").arg(java_class->name()).arg(java_class->qualifiedCppName()); |
714 s << QString("QTD_EXTERN QTD_DLL_PUBLIC bool qtd_%1_QTypeInfo_isDummy() { return (bool) QTypeInfo<%2>::isDummy; }\n").arg(java_class->name()).arg(java_class->qualifiedCppName()); | 715 s << QString("QTD_EXTERN QTD_EXPORT bool qtd_%1_QTypeInfo_isDummy() { return (bool) QTypeInfo<%2>::isDummy; }\n").arg(java_class->name()).arg(java_class->qualifiedCppName()); |
715 } | 716 } |
716 | 717 |
717 void CppImplGenerator::writeVirtualDispatchFunction(QTextStream &s, const AbstractMetaFunction *function, const AbstractMetaClass *java_class, bool d_export) | 718 void CppImplGenerator::writeVirtualDispatchFunction(QTextStream &s, const AbstractMetaFunction *function, const AbstractMetaClass *java_class, bool d_export) |
718 { | 719 { |
719 uint options2 = ReturnType | ExternC; | 720 uint options2 = ReturnType | ExternC; |
721 | 722 |
722 AbstractMetaFunction::Options opts(AbstractMetaFunction::NoExternNamespace | AbstractMetaFunction::DeclaringClass); | 723 AbstractMetaFunction::Options opts(AbstractMetaFunction::NoExternNamespace | AbstractMetaFunction::DeclaringClass); |
723 QString f_name = function->marshalledName(opts) + "_dispatch"; | 724 QString f_name = function->marshalledName(opts) + "_dispatch"; |
724 | 725 |
725 if (d_export) { | 726 if (d_export) { |
726 QString qtdExtern = "extern(C)"; // TODO: should be settable via a generator switch | 727 QString qtdExtern = "extern(C)"; |
727 if (cpp_shared) { | 728 QString qtdExport; |
728 | 729 if (global.targetPlatform == Global::Win32Target) |
729 s << qtdExtern << "{ extern export " << return_type << " function"; | 730 qtdExport = "export "; |
731 | |
732 | |
733 if (global.cppShared) { | |
734 | |
735 s << qtdExtern << "{ extern " << qtdExport << return_type << " function"; | |
730 writeVirtualDispatchArguments(s, function, d_export); | 736 writeVirtualDispatchArguments(s, function, d_export); |
731 s << " qtd_" << f_name << "; }" << endl; | 737 s << " qtd_" << f_name << "; }" << endl; |
732 | 738 |
733 s << qtdExtern << " " << return_type << " qtd_export_" << f_name; | 739 s << qtdExtern << " " << return_type << " qtd_export_" << f_name; |
734 writeVirtualDispatchArguments(s, function, d_export); | 740 writeVirtualDispatchArguments(s, function, d_export); |
737 s << qtdExtern << " " << return_type << " qtd_" << f_name; | 743 s << qtdExtern << " " << return_type << " qtd_" << f_name; |
738 writeVirtualDispatchArguments(s, function, d_export); | 744 writeVirtualDispatchArguments(s, function, d_export); |
739 } | 745 } |
740 } else { | 746 } else { |
741 QString module = packageToQtModule(java_class->package()); | 747 QString module = packageToQtModule(java_class->package()); |
742 s << "QTD_EXPORT_DECL(" << module << ", " << return_type << ", " << f_name << ", "; | 748 s << "QTD_FUNC_DECL(" << module << ", " << return_type << ", " << f_name << ", "; |
743 writeVirtualDispatchArguments(s, function, d_export); | 749 writeVirtualDispatchArguments(s, function, d_export); |
744 s << ")" << endl; | 750 s << ")" << endl; |
745 | 751 |
746 if (function->declaringClass() == java_class) { | 752 if (function->declaringClass() == java_class) { |
747 s << "QTD_EXPORT(" << module << ", " << f_name << ")" << endl; | 753 s << "QTD_FUNC(" << module << ", " << f_name << ")" << endl; |
748 } | 754 } |
749 } | 755 } |
750 } | 756 } |
751 | 757 |
752 void CppImplGenerator::writeShellVirtualFunction(QTextStream &s, const AbstractMetaFunction *function, | 758 void CppImplGenerator::writeShellVirtualFunction(QTextStream &s, const AbstractMetaFunction *function, |
903 { | 909 { |
904 QString initArgs = "VoidFunc *virts"; | 910 QString initArgs = "VoidFunc *virts"; |
905 if (java_class->name() == "QObject") | 911 if (java_class->name() == "QObject") |
906 initArgs += ", VoidFunc *sigs"; | 912 initArgs += ", VoidFunc *sigs"; |
907 | 913 |
908 s << "QTD_EXTERN QTD_DLL_EXPORT void qtd_" << java_class->name() | 914 s << "QTD_EXTERN QTD_EXPORT void qtd_" << java_class->name() |
909 << QString("_initCallBacks(%1) {").arg(initArgs) << endl; | 915 << QString("_initCallBacks(%1) {").arg(initArgs) << endl; |
910 | 916 |
911 // virtual functions handlers | 917 // virtual functions handlers |
912 AbstractMetaFunctionList virtualFunctions = java_class->virtualFunctions(); | 918 AbstractMetaFunctionList virtualFunctions = java_class->virtualFunctions(); |
913 AbstractMetaFunction::Options opts(AbstractMetaFunction::DeclaringClass | AbstractMetaFunction::NoExternNamespace); | 919 AbstractMetaFunction::Options opts(AbstractMetaFunction::DeclaringClass | AbstractMetaFunction::NoExternNamespace); |
1288 << " return _id;" << endl | 1294 << " return _id;" << endl |
1289 << " emit_callbacks_" << java_class->name() << "[_id](dId, _a);" << endl | 1295 << " emit_callbacks_" << java_class->name() << "[_id](dId, _a);" << endl |
1290 << " return -1;" << endl | 1296 << " return -1;" << endl |
1291 << "}" << endl << endl; | 1297 << "}" << endl << endl; |
1292 */ | 1298 */ |
1293 s << "QTD_EXTERN QTD_DLL_PUBLIC void qtd_" << className << "_createEntity(void *nativeId, void* dId)" << endl | 1299 s << "QTD_EXTERN QTD_EXPORT void qtd_" << className << "_createEntity(void *nativeId, void* dId)" << endl |
1294 << "{" << endl | 1300 << "{" << endl |
1295 << " new " << entityName << "((QObject*)nativeId, dId);" << endl | 1301 << " new " << entityName << "((QObject*)nativeId, dId);" << endl |
1296 << "}" << endl << endl; | 1302 << "}" << endl << endl; |
1297 } | 1303 } |
1298 | 1304 |
1350 << "}" << endl << endl; | 1356 << "}" << endl << endl; |
1351 */ | 1357 */ |
1352 | 1358 |
1353 QString module = packageToQtModule(java_class->package()); | 1359 QString module = packageToQtModule(java_class->package()); |
1354 | 1360 |
1355 s << "QTD_EXPORT_DECL(" << module << ", const QMetaObject*, QObject_metaObject_dispatch, (void *dId))" << endl | 1361 s << "QTD_FUNC_DECL(" << module << ", const QMetaObject*, QObject_metaObject_dispatch, (void *dId))" << endl |
1356 << "QTD_EXPORT_DECL(" << module << ", int, QObject_qt_metacall_dispatch, (void *dId, QMetaObject::Call _c, int _id, void **_a))" << endl; | 1362 << "QTD_FUNC_DECL(" << module << ", int, QObject_qt_metacall_dispatch, (void *dId, QMetaObject::Call _c, int _id, void **_a))" << endl; |
1357 | 1363 |
1358 if (java_class->name() == "QObject") { | 1364 if (java_class->name() == "QObject") { |
1359 s << "QTD_EXPORT(" << module << ", QObject_metaObject_dispatch)" << endl | 1365 s << "QTD_FUNC(" << module << ", QObject_metaObject_dispatch)" << endl |
1360 << "QTD_EXPORT(" << module << ", QObject_qt_metacall_dispatch)" << endl; | 1366 << "QTD_FUNC(" << module << ", QObject_qt_metacall_dispatch)" << endl; |
1361 } | 1367 } |
1362 | 1368 |
1363 // TODO: QMetaObject should be included in the typesystem | 1369 // TODO: QMetaObject should be included in the typesystem |
1364 s << endl | 1370 s << endl |
1365 << "const QMetaObject * " << shellClassName(java_class) << "::metaObject() const" << endl | 1371 << "const QMetaObject * " << shellClassName(java_class) << "::metaObject() const" << endl |
1382 << "int " << shellClassName(java_class) << "::__override_qt_metacall(QMetaObject::Call _c, int _id, void **_a)" << endl | 1388 << "int " << shellClassName(java_class) << "::__override_qt_metacall(QMetaObject::Call _c, int _id, void **_a)" << endl |
1383 << "{" << endl | 1389 << "{" << endl |
1384 << " return " << java_class->qualifiedCppName() << "::qt_metacall(_c, _id, _a);" | 1390 << " return " << java_class->qualifiedCppName() << "::qt_metacall(_c, _id, _a);" |
1385 << "}" << endl << endl | 1391 << "}" << endl << endl |
1386 | 1392 |
1387 << "QTD_EXTERN QTD_DLL_PUBLIC int qtd_" << java_class->name() << "_qt_metacall(void* __this_nativeId, QMetaObject::Call _c, int _id, void **_a)" | 1393 << "QTD_EXTERN QTD_EXPORT int qtd_" << java_class->name() << "_qt_metacall(void* __this_nativeId, QMetaObject::Call _c, int _id, void **_a)" |
1388 << "{" << endl | 1394 << "{" << endl |
1389 << " " << shellClassName(java_class) << " *__qt_this = (" << shellClassName(java_class) << " *) __this_nativeId;" << endl | 1395 << " " << shellClassName(java_class) << " *__qt_this = (" << shellClassName(java_class) << " *) __this_nativeId;" << endl |
1390 << " return __qt_this->__override_qt_metacall(_c, _id, _a);" << endl | 1396 << " return __qt_this->__override_qt_metacall(_c, _id, _a);" << endl |
1391 << "}" << endl << endl; | 1397 << "}" << endl << endl; |
1392 } | 1398 } |
1801 s << "}" << endl << endl; | 1807 s << "}" << endl << endl; |
1802 } | 1808 } |
1803 | 1809 |
1804 void CppImplGenerator::writeQtdEntityFunction(QTextStream &s, const AbstractMetaClass *java_class) | 1810 void CppImplGenerator::writeQtdEntityFunction(QTextStream &s, const AbstractMetaClass *java_class) |
1805 { | 1811 { |
1806 s << "QTD_EXTERN QTD_DLL_PUBLIC void *__" << java_class->name() << "_entity(void *q_ptr)" << endl; | 1812 s << "QTD_EXTERN QTD_EXPORT void *__" << java_class->name() << "_entity(void *q_ptr)" << endl; |
1807 s << "{" << endl; | 1813 s << "{" << endl; |
1808 { | 1814 { |
1809 Indentation indent(INDENT); | 1815 Indentation indent(INDENT); |
1810 s << INDENT << "QtdObjectLink* a = dynamic_cast<QtdObjectLink*>((" << java_class->qualifiedCppName() << "*)q_ptr);" << endl | 1816 s << INDENT << "QtdObjectLink* a = dynamic_cast<QtdObjectLink*>((" << java_class->qualifiedCppName() << "*)q_ptr);" << endl |
1811 << INDENT << "if (a != NULL)" << endl | 1817 << INDENT << "if (a != NULL)" << endl |
2011 else s << "QVariant*"; | 2017 else s << "QVariant*"; |
2012 } else | 2018 } else |
2013 s << translateType(argument->type(), EnumAsInts, d_export); | 2019 s << translateType(argument->type(), EnumAsInts, d_export); |
2014 } | 2020 } |
2015 else if (d_type->name() == "QModelIndex") { | 2021 else if (d_type->name() == "QModelIndex") { |
2016 if(d_export && dVersion == 2 && d_type->isConstant()) | 2022 if(d_export && global.dVersion == 2 && d_type->isConstant()) |
2017 s << "const(QModelIndexAccessor)"; | 2023 s << "const(QModelIndexAccessor)"; |
2018 else | 2024 else |
2019 s << "QModelIndexAccessor"; | 2025 s << "QModelIndexAccessor"; |
2020 } else if (te->isStructInD()) | 2026 } else if (te->isStructInD()) |
2021 s << te->qualifiedCppName(); | 2027 s << te->qualifiedCppName(); |
2360 } | 2366 } |
2361 | 2367 |
2362 void CppImplGenerator::writeFinalDestructor(QTextStream &s, const AbstractMetaClass *cls) | 2368 void CppImplGenerator::writeFinalDestructor(QTextStream &s, const AbstractMetaClass *cls) |
2363 { | 2369 { |
2364 if (cls->hasConstructors() && cls->isDestructorBase()) { | 2370 if (cls->hasConstructors() && cls->isDestructorBase()) { |
2365 s << INDENT << "QTD_EXTERN QTD_DLL_PUBLIC void qtd_" << cls->name() << "_delete(void* nativeId)" << endl | 2371 s << INDENT << "QTD_EXTERN QTD_EXPORT void qtd_" << cls->name() << "_delete(void* nativeId)" << endl |
2366 << INDENT << "{" << endl | 2372 << INDENT << "{" << endl |
2367 << INDENT << " delete (" << shellClassName(cls) << "*)nativeId;" << endl | 2373 << INDENT << " delete (" << shellClassName(cls) << "*)nativeId;" << endl |
2368 << INDENT << "}" << endl << endl; | 2374 << INDENT << "}" << endl << endl; |
2369 | 2375 |
2370 s << INDENT << "QTD_EXTERN QTD_DLL_PUBLIC void qtd_" << cls->name() << "_destroy(void* nativeId)" << endl | 2376 s << INDENT << "QTD_EXTERN QTD_EXPORT void qtd_" << cls->name() << "_destroy(void* nativeId)" << endl |
2371 << INDENT << "{" << endl | 2377 << INDENT << "{" << endl |
2372 << INDENT << " call_destructor((" << shellClassName(cls) << "*)nativeId);" << endl | 2378 << INDENT << " call_destructor((" << shellClassName(cls) << "*)nativeId);" << endl |
2373 << INDENT << "}" << endl << endl; | 2379 << INDENT << "}" << endl << endl; |
2374 } | 2380 } |
2375 } | 2381 } |
3701 if (java_type->typeEntry()->isValue()) | 3707 if (java_type->typeEntry()->isValue()) |
3702 return "void*"; | 3708 return "void*"; |
3703 else | 3709 else |
3704 return d_name + " "+ QString(java_type->actualIndirections(), '*'); | 3710 return d_name + " "+ QString(java_type->actualIndirections(), '*'); |
3705 } else if (java_type->isNativePointer()) { | 3711 } else if (java_type->isNativePointer()) { |
3706 if (java_type->typeEntry()->isStructInD() && dVersion == 2 && java_type->isConstant() && d_export) | 3712 if (java_type->typeEntry()->isStructInD() && global.dVersion == 2 && java_type->isConstant() && d_export) |
3707 return "const(" + d_name + QString(java_type->indirections()-1, '*') + ")*"; | 3713 return "const(" + d_name + QString(java_type->indirections()-1, '*') + ")*"; |
3708 else if (java_type->typeEntry()->isValue()) | 3714 else if (java_type->typeEntry()->isValue()) |
3709 return "void*"; | 3715 return "void*"; |
3710 else if (java_type->typeEntry()->isEnum() && d_export) | 3716 else if (java_type->typeEntry()->isEnum() && d_export) |
3711 return "int" + QString(java_type->indirections(), '*'); | 3717 return "int" + QString(java_type->indirections(), '*'); |
3712 else { | 3718 else { |
3713 if (java_type->isConstant() && dVersion == 2 && d_export) | 3719 if (java_type->isConstant() && global.dVersion == 2 && d_export) |
3714 return "const (" + d_name + QString(java_type->indirections(), '*') + ")"; | 3720 return "const (" + d_name + QString(java_type->indirections(), '*') + ")"; |
3715 else | 3721 else |
3716 return d_name + QString(java_type->indirections(), '*'); | 3722 return d_name + QString(java_type->indirections(), '*'); |
3717 } | 3723 } |
3718 } else { | 3724 } else { |