瀏覽代碼

* pas2jni: TClass helper must be generated only for the system unit.

git-svn-id: trunk@40462 -
yury 6 年之前
父節點
當前提交
1cc3c199c8
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      utils/pas2jni/writer.pas

+ 1 - 1
utils/pas2jni/writer.pas

@@ -2075,7 +2075,7 @@ begin
     end;
     end;
 
 
     // Class ref helpers
     // Class ref helpers
-    if FClasses.IndexOf('system.TClass', nil) >= 0 then begin
+    if (u.Name = 'system') and (FClasses.IndexOf('system.TClass', nil) >= 0) then begin
       Fjs.WriteLn('native static long GetClassRef(int index);');
       Fjs.WriteLn('native static long GetClassRef(int index);');
       AddNativeMethod(u, '_GetClassRef', 'GetClassRef', '(I)J');
       AddNativeMethod(u, '_GetClassRef', 'GetClassRef', '(I)J');
       Fjs.WriteLn('static TClass GetTClass(int index) { TClass c = new TClass(null); c._pasobj=GetClassRef(index); return c; }');
       Fjs.WriteLn('static TClass GetTClass(int index) { TClass c = new TClass(null); c._pasobj=GetClassRef(index); return c; }');