ソースを参照

* store JVM namespace separately from unitname so it doesn't conflict with
dotted unit names

git-svn-id: branches/jvmbackend@20872 -

Jonas Maebe 13 年 前
コミット
93210cc419
2 ファイル変更19 行追加20 行削除
  1. 18 20
      compiler/fppu.pas
  2. 1 0
      compiler/ppu.pas

+ 18 - 20
compiler/fppu.pas

@@ -952,17 +952,13 @@ var
          repeat
            b:=ppufile.readentry;
            case b of
+             ibjvmnamespace :
+               begin
+                 namespace:=stringdup(ppufile.getstring);
+               end;
              ibmodulename :
                begin
                  newmodulename:=ppufile.getstring;
-                 { namespace? }
-                 b:=rpos('.',newmodulename);
-                 if b<>0 then
-                   begin
-                     stringdispose(namespace);
-                     namespace:=stringdup(copy(newmodulename,1,b-1));
-                     delete(newmodulename,1,b);
-                   end;
                  if (cs_check_unit_name in current_settings.globalswitches) and
                     (upper(newmodulename)<>modulename^) then
                    Message2(unit_f_unit_name_error,realmodulename^,newmodulename);
@@ -1054,8 +1050,6 @@ var
 
 
     procedure tppumodule.writeppu;
-      var
-        ns: string;
       begin
          Message1(unit_u_ppu_write,realmodulename^);
 
@@ -1078,11 +1072,14 @@ var
          if not ppufile.createfile then
           Message(unit_f_ppu_cannot_write);
 
-         { first the unitname }
-         ns:='';
+         { first the (JVM) namespace }
          if assigned(namespace) then
-          ns:=namespace^+'.';
-         ppufile.putstring(ns+realmodulename^);
+           begin
+             ppufile.putstring(namespace^);
+             ppufile.writeentry(ibjvmnamespace);
+           end;
+         { the unitname }
+         ppufile.putstring(realmodulename^);
          ppufile.writeentry(ibmodulename);
 
          ppufile.putsmallset(moduleoptions);
@@ -1221,8 +1218,6 @@ var
 
 
     procedure tppumodule.getppucrc;
-      var
-        ns: string;
       begin
 {$ifdef Test_Double_checksum_write}
          Assign(CRCFile,s+'.INT')
@@ -1235,11 +1230,14 @@ var
          if not ppufile.createfile then
            Message(unit_f_ppu_cannot_write);
 
-         { first the unitname }
-         ns:='';
+         { first the (JVM) namespace }
          if assigned(namespace) then
-          ns:=namespace^+'.';
-         ppufile.putstring(ns+realmodulename^);
+           begin
+             ppufile.putstring(namespace^);
+             ppufile.writeentry(ibjvmnamespace);
+           end;
+         { the unitname }
+         ppufile.putstring(realmodulename^);
          ppufile.writeentry(ibmodulename);
 
          ppufile.putsmallset(moduleoptions);

+ 1 - 0
compiler/ppu.pas

@@ -135,6 +135,7 @@ const
   ibrecsymtableoptions = 91;
   { target-specific things }
   iblinkotherframeworks = 100;
+  ibjvmnamespace = 101;
 
 { unit flags }
   uf_init                = $000001; { unit has initialization section }