소스 검색

* don't load the controller unit if the currently compiled unit *is* the controller unit (which might happen if one compiles the controller unit as part of a program)

Sven/Sarah Barth 3 년 전
부모
커밋
c3f27a2f1c
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      compiler/pmodules.pas

+ 2 - 1
compiler/pmodules.pas

@@ -410,7 +410,8 @@ implementation
         { CPU targets with microcontroller support can add a controller specific unit }
         if ControllerSupport and (target_info.system in (systems_embedded+systems_freertos)) and
           (current_settings.controllertype<>ct_none) and
-          (embedded_controllers[current_settings.controllertype].controllerunitstr<>'') then
+          (embedded_controllers[current_settings.controllertype].controllerunitstr<>'') and
+          (embedded_controllers[current_settings.controllertype].controllerunitstr<>current_module.modulename^) then
           AddUnit(embedded_controllers[current_settings.controllertype].controllerunitstr);
 {$pop}
 {$ifdef XTENSA}