瀏覽代碼

- 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];
           m_property,m_default_inline,m_except];
        tpmodeswitches     : tmodeswitches=
        tpmodeswitches     : tmodeswitches=
          [m_tp7,m_all,m_tp_procvar,m_duplicate_names];
          [m_tp7,m_all,m_tp_procvar,m_duplicate_names];
+{$ifdef gpc_mode}
        gpcmodeswitches    : tmodeswitches=
        gpcmodeswitches    : tmodeswitches=
          [m_gpc,m_all,m_tp_procvar];
          [m_gpc,m_all,m_tp_procvar];
+{$endif}
        macmodeswitches : tmodeswitches=
        macmodeswitches : tmodeswitches=
          [m_mac,m_all,m_result,m_cvar_support,m_mac_procvar];
          [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) }
        { Switches which can be changed by a mode (fpc,tp7,delphi) }
        tmodeswitch = (m_none,m_all, { needed for keyword }
        tmodeswitch = (m_none,m_all, { needed for keyword }
          { generic }
          { 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 }
          { more specific }
          m_class,               { delphi class model }
          m_class,               { delphi class model }
          m_objpas,              { load objpas unit }
          m_objpas,              { load objpas unit }

+ 2 - 0
compiler/options.pas

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

+ 8 - 2
compiler/scanner.pas

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