Browse Source

+ support the $fpcmemorymodel macro in fpc.cfg

git-svn-id: trunk@29315 -
nickysn 10 years ago
parent
commit
b193073e32
2 changed files with 13 additions and 0 deletions
  1. 5 0
      compiler/globals.pas
  2. 8 0
      compiler/globtype.pas

+ 5 - 0
compiler/globals.pas

@@ -836,6 +836,11 @@ implementation
            Replace(s,'$FPCTARGET',target_full_string);
          Replace(s,'$SUBARCH',lower(cputypestr[init_settings.cputype]));
          Replace(s,'$FPCABI',lower(abiinfo[target_info.abi].name));
+{$ifdef i8086}
+         Replace(s,'$FPCMEMORYMODEL',lower(x86memorymodelstr[init_settings.x86memorymodel]));
+{$else i8086}
+         Replace(s,'$FPCMEMORYMODEL','flat');
+{$endif i8086}
 {$ifdef mswindows}
          ReplaceSpecialFolder('$LOCAL_APPDATA',CSIDL_LOCAL_APPDATA);
          ReplaceSpecialFolder('$APPDATA',CSIDL_APPDATA);

+ 8 - 0
compiler/globtype.pas

@@ -705,6 +705,14 @@ interface
 
     type
       tx86memorymodel = (mm_tiny,mm_small,mm_medium,mm_compact,mm_large,mm_huge);
+    const
+      x86memorymodelstr : array[tx86memorymodel] of string[7]=(
+        'TINY',
+        'SMALL',
+        'MEDIUM',
+        'COMPACT',
+        'LARGE',
+        'HUGE');
 
   { hide Sysutils.ExecuteProcess in units using this one after SysUtils}
   const