Преглед на файлове

+ {$targetswitch xxx} directive that enables changing target switches
(-CTxxx) in the source code

git-svn-id: trunk@23563 -

Jonas Maebe преди 12 години
родител
ревизия
a51e64bd4d
променени са 1 файла, в които са добавени 19 реда и са изтрити 0 реда
  1. 19 0
      compiler/scandir.pas

+ 19 - 0
compiler/scandir.pas

@@ -1154,6 +1154,24 @@ unit scandir;
       end;
 {$endif}
 
+    procedure dir_targetswitch;
+      var
+        name, value: string;
+      begin
+        { note: *not* recorded in the tokenstream, so not replayed for generics }
+        current_scanner.skipspace;
+        name:=current_scanner.readid;
+        if c='=' then
+          begin
+            current_scanner.readchar;
+            current_scanner.readid;
+            value:=orgpattern;
+            UpdateTargetSwitchStr(name+'='+value,current_settings.targetswitches,current_module.in_global);
+          end
+        else
+          UpdateTargetSwitchStr(name,current_settings.targetswitches,current_module.in_global);
+      end;
+
     procedure dir_typedaddress;
       begin
         do_delphiswitch('T');
@@ -1591,6 +1609,7 @@ unit scandir;
 {$ifdef powerpc}
         AddDirective('SYSCALL',directive_all, @dir_syscall);
 {$endif powerpc}
+        AddDirective('TARGETSWITCH',directive_all, @dir_targetswitch);
         AddDirective('THREADNAME',directive_all, @dir_threadname);
         AddDirective('TYPEDADDRESS',directive_all, @dir_typedaddress);
         AddDirective('TYPEINFO',directive_all, @dir_typeinfo);