瀏覽代碼

Avoid some range check errors for msdos target

git-svn-id: trunk@24517 -
pierre 12 年之前
父節點
當前提交
7f5aa5a441
共有 2 個文件被更改,包括 12 次插入1 次删除
  1. 5 0
      rtl/inc/threadh.inc
  2. 7 1
      rtl/msdos/system.pp

+ 5 - 0
rtl/inc/threadh.inc

@@ -15,8 +15,13 @@
  **********************************************************************}
 
 const
+{$ifndef FPC_USE_SMALL_DEFAULTSTACKSIZE}
   { includes 16384 bytes margin for stackchecking }
   DefaultStackSize = 4*1024*1024;
+{$else i.e. FPC_USE_SMALL_DEFAULTSTACKSIZE}
+  { Special value of Default stack size }
+  DefaultStackSize = 16 * 1024;
+{$endif not FPC_USE_SMALL_DEFAULTSTACKSIZE}
 
 { every platform can have it's own implementation of GetCPUCount; use the define
   HAS_GETCPUCOUNT to disable the default implementation which simply returns 1 }

+ 7 - 1
rtl/msdos/system.pp

@@ -7,6 +7,12 @@ interface
 {$DEFINE FPC_INCLUDE_SOFTWARE_MUL}
 {$DEFINE FPC_INCLUDE_SOFTWARE_MOD_DIV}
 
+{$DEFINE FPC_USE_SMALL_DEFAULTSTACKSIZE}
+{ To avoid warnings in thread.inc code,
+  but value must be really given after
+  systemh.inc is included otherwise the
+  $mode switch is not effective }
+
 {$I systemh.inc}
 
 const
@@ -24,7 +30,7 @@ const
 
 const
 { Default filehandles }
-  UnusedHandle    = -1;
+  UnusedHandle    = $ffff;{ instead of -1, as it is a word value}
   StdInputHandle  = 0;
   StdOutputHandle = 1;
   StdErrorHandle  = 2;