Browse Source

* Allow using constants in {$IF } directive in OBJFPC mode.
* Define FPC_OBJFPC_EXTENDED_IF to allow to test if this feature can be safely used.

git-svn-id: trunk@9342 -

yury 17 years ago
parent
commit
99a8012472
2 changed files with 2 additions and 1 deletions
  1. 1 0
      compiler/options.pas
  2. 1 1
      compiler/scanner.pas

+ 1 - 0
compiler/options.pas

@@ -2141,6 +2141,7 @@ begin
   def_system_macro('FPC_STRTOCHARARRAYPROC');
   def_system_macro('FPC_STRTOCHARARRAYPROC');
   def_system_macro('FPC_NEW_BIGENDIAN_SETS');
   def_system_macro('FPC_NEW_BIGENDIAN_SETS');
   def_system_macro('FPC_STRTOSHORTSTRINGPROC');
   def_system_macro('FPC_STRTOSHORTSTRINGPROC');
+  def_system_macro('FPC_OBJFPC_EXTENDED_IF');
 {$ifdef x86}
 {$ifdef x86}
   def_system_macro('FPC_HAS_INTERNAL_ABS_LONG');
   def_system_macro('FPC_HAS_INTERNAL_ABS_LONG');
 {$endif}
 {$endif}

+ 1 - 1
compiler/scanner.pas

@@ -1012,7 +1012,7 @@ In case not, the value returned can be arbitrary.
 
 
                     { Default is to return the original symbol }
                     { Default is to return the original symbol }
                     read_factor:=hs;
                     read_factor:=hs;
-                    if eval and (m_delphi in current_settings.modeswitches) and (ctetString in factorType) then
+                    if eval and ([m_delphi,m_objfpc]*current_settings.modeswitches<>[]) and (ctetString in factorType) then
                       if searchsym(current_scanner.preproc_pattern,srsym,srsymtable) then
                       if searchsym(current_scanner.preproc_pattern,srsym,srsymtable) then
                         begin
                         begin
                           case srsym.typ of
                           case srsym.typ of