From b193073e32124695e238d17a486170fe6639d4bc Mon Sep 17 00:00:00 2001 From: nickysn Date: Tue, 23 Dec 2014 18:55:57 +0000 Subject: [PATCH] + support the $fpcmemorymodel macro in fpc.cfg git-svn-id: trunk@29315 - --- compiler/globals.pas | 5 +++++ compiler/globtype.pas | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/compiler/globals.pas b/compiler/globals.pas index 585a42ee6f..6176daf0b5 100644 --- a/compiler/globals.pas +++ b/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); diff --git a/compiler/globtype.pas b/compiler/globtype.pas index b48a22f7b9..af1e4c32a0 100644 --- a/compiler/globtype.pas +++ b/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