浏览代码

- Put gpc mode between ifdefs. The only thing it does it disable all
features, this is not gpc compatibility.

git-svn-id: trunk@6518 -

daniel 18 年之前
父节点
当前提交
5aef9bc086
共有 4 个文件被更改,包括 14 次插入3 次删除
  1. 2 0
      compiler/globals.pas
  2. 2 1
      compiler/globtype.pas
  3. 2 0
      compiler/options.pas
  4. 8 2
      compiler/scanner.pas

+ 2 - 0
compiler/globals.pas

@@ -63,8 +63,10 @@ interface
           m_property,m_default_inline,m_except];
        tpmodeswitches     : tmodeswitches=
          [m_tp7,m_all,m_tp_procvar,m_duplicate_names];
+{$ifdef gpc_mode}
        gpcmodeswitches    : tmodeswitches=
          [m_gpc,m_all,m_tp_procvar];
+{$endif}
        macmodeswitches : tmodeswitches=
          [m_mac,m_all,m_result,m_cvar_support,m_mac_procvar];
 

+ 2 - 1
compiler/globtype.pas

@@ -180,7 +180,8 @@ interface
        { Switches which can be changed by a mode (fpc,tp7,delphi) }
        tmodeswitch = (m_none,m_all, { needed for keyword }
          { generic }
-         m_fpc,m_objfpc,m_delphi,m_tp7,m_gpc,m_mac,
+         m_fpc,m_objfpc,m_delphi,m_tp7,m_mac,
+         {$ifdef fpc_mode}m_gpc,{$endif}
          { more specific }
          m_class,               { delphi class model }
          m_objpas,              { load objpas unit }

+ 2 - 0
compiler/options.pas

@@ -1069,8 +1069,10 @@ begin
                          include(init_settings.moduleswitches,cs_support_macro);
                        'o' : //an alternative to -Mtp
                          SetCompileMode('TP',true);
+{$ifdef gpc_mode}
                        'p' : //an alternative to -Mgpc
                          SetCompileMode('GPC',true);
+{$endif}
                        's' :
                          include(init_settings.globalswitches,cs_constructor_name);
                        't' :

+ 8 - 2
compiler/scanner.pas

@@ -282,9 +282,11 @@ implementation
           current_settings.modeswitches:=objfpcmodeswitches;
           { TODO: enable this for 2.3/2.9 }
           //  include(current_settings.localswitches, cs_typed_addresses);
-        end else
-         if s='GPC' then
+        end 
+{$ifdef gpc_mode}
+        else if s='GPC' then
           current_settings.modeswitches:=gpcmodeswitches
+{$endif}
         else
          if s='MACPAS' then
           current_settings.modeswitches:=macmodeswitches
@@ -379,8 +381,10 @@ implementation
               undef_system_macro('FPC_TP')
             else if (m_objfpc in oldmodeswitches) then
               undef_system_macro('FPC_OBJFPC')
+{$ifdef gpc_mode}
             else if (m_gpc in oldmodeswitches) then
               undef_system_macro('FPC_GPC')
+{$endif}
             else if (m_mac in oldmodeswitches) then
               undef_system_macro('FPC_MACPAS');
 
@@ -391,8 +395,10 @@ implementation
               def_system_macro('FPC_TP')
             else if (m_objfpc in current_settings.modeswitches) then
               def_system_macro('FPC_OBJFPC')
+{$ifdef gpc_mode}
             else if (m_gpc in current_settings.modeswitches) then
               def_system_macro('FPC_GPC')
+{$endif}
             else if (m_mac in current_settings.modeswitches) then
               def_system_macro('FPC_MACPAS');
          end;