Browse Source

* Fix build of nativent

Michaël Van Canneyt 1 năm trước cách đây
mục cha
commit
c52794f943
2 tập tin đã thay đổi với 6 bổ sung15 xóa
  1. 4 0
      compiler/compiler.pas
  2. 2 15
      compiler/parser.pas

+ 4 - 0
compiler/compiler.pas

@@ -302,6 +302,10 @@ begin
          m:=tppumodule.create(Nil,'',inputfilepath+inputfilename,false);
          m.state:=ms_compile;
          m.is_initial:=true;
+         { We need to add the initial module manually to the list of units }
+         addloadedunit(m);
+         main_module:=m;
+         m.state:=ms_compile;
          task_handler.addmodule(m);
          task_handler.processqueue;
          end;

+ 2 - 15
compiler/parser.pas

@@ -445,21 +445,8 @@ implementation
          { Load current state from the init values }
          current_settings:=init_settings;
 
-       { reset the unit or create a new program }
-         { a unit compiled at command line must be inside the loaded_unit list }
-         if (module.is_initial) then
-           begin
-             if assigned(current_module) then
-               internalerror(200501158);
-             set_current_module(module);
-             addloadedunit(module);
-             main_module:=module;
-             module.state:=ms_compile;
-           end
-         else
-           set_current_module(module);
-         if not(assigned(current_module) and
-                (current_module.state in [ms_compile])) then
+         set_current_module(module);
+         if not (module.state in [ms_compile]) then
            internalerror(200212281);
 
          { load current asmdata from current_module }