浏览代码

Add a possibility to track if a unit was loaded from a package.

fmodule.pas, tmodule:
  + new field "package" which is Nil if the unit is not (yet) part of a package or a reference to the package this unit was loaded from
fppu.pas, tppumodule:
  * loadfrompackage: set the "package" field of the module to the package it's loaded from.

git-svn-id: branches/svenbarth/packages@29038 -
svenbarth 10 年之前
父节点
当前提交
bbfb7c4cad
共有 2 个文件被更改,包括 3 次插入1 次删除
  1. 2 1
      compiler/fmodule.pas
  2. 1 0
      compiler/fppu.pas

+ 2 - 1
compiler/fmodule.pas

@@ -43,7 +43,7 @@ interface
 
     uses
        cutils,cclasses,cfileutl,
-       globtype,finput,ogbase,
+       globtype,finput,ogbase,fpkg,
        symbase,symsym,
        wpobase,
        aasmbase,aasmtai,aasmdata;
@@ -170,6 +170,7 @@ interface
         linkotherstaticlibs,
         linkotherframeworks  : tlinkcontainer;
         mainname      : pshortstring; { alternate name for "main" procedure }
+        package       : tpackage;
 
         used_units           : tlinkedlist;
         dependent_units      : tlinkedlist;

+ 1 - 0
compiler/fppu.pas

@@ -554,6 +554,7 @@ var
                 filename:=pkgunit^.ppufile;
                 if not SearchPathList(unitsearchpath) then
                   exit;
+                package:=pkg^.package;
 
                 { now load the unit and all used units }
                 load_interface;