diff generator/cppimplgenerator.cpp @ 190:a1b48a630f73

D2 support, simple stuff works now
author eldar
date Sun, 12 Jul 2009 20:51:37 +0000
parents 7dd099050621
children 1349940724eb
line wrap: on
line diff
--- a/generator/cppimplgenerator.cpp	Sun Jul 12 19:45:29 2009 +0000
+++ b/generator/cppimplgenerator.cpp	Sun Jul 12 20:51:37 2009 +0000
@@ -3716,13 +3716,15 @@
         else
             return d_name + " "+ QString(java_type->actualIndirections(), '*');
     } else if (java_type->isNativePointer()) {
-        if (java_type->typeEntry()->isValue())
+        if (java_type->typeEntry()->isStructInD() && dVersion == 2 && java_type->isConstant() && d_export)
+            return "const(" + d_name + QString(java_type->indirections()-1, '*') + ")*";
+        else if (java_type->typeEntry()->isValue())
             return "void*";
         else if (java_type->typeEntry()->isEnum() && d_export)
             return "int" + QString(java_type->indirections(), '*');
         else {
             if (java_type->isConstant() && dVersion == 2 && d_export)
-                return "const (" + d_name + ")" + QString(java_type->indirections(), '*');
+                return "const (" + d_name + QString(java_type->indirections(), '*') + ")";
             else
                 return d_name + QString(java_type->indirections(), '*');
         }