jsystemh_types.inc 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738
  1. {
  2. This file contains the OS independent declarations of the system unit
  3. This file is part of the Free Pascal Run time library.
  4. Copyright (c) 1999-2005 by the Free Pascal development team
  5. See the File COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. {****************************************************************************
  12. Needed switches
  13. ****************************************************************************}
  14. {$I-,Q-,H-,R-,V-}
  15. {$mode objfpc}
  16. { At least 2.4.0 is required }
  17. {$if defined(VER1) or defined(VER2_0) or defined(VER2_2) }
  18. {$fatal You need at least FPC 2.4.0 to build this version of FPC}
  19. {$endif}
  20. { Using inlining for small system functions/wrappers }
  21. {$inline on}
  22. {$ifndef DISABLE_SYSTEMINLINE}
  23. {$define SYSTEMINLINE}
  24. {$endif}
  25. { don't use FPU registervariables on the i386 and i8086 }
  26. {$if defined(CPUI386) or defined(CPUI8086)}
  27. {$maxfpuregisters 0}
  28. {$endif CPUI386 or CPUI8086}
  29. { the assembler helpers need this}
  30. {$ifdef CPUPOWERPC}
  31. {$goto+}
  32. {$endif CPUPOWERPC}
  33. {$ifdef CPUAVR}
  34. {$goto+}
  35. {$endif CPUAVR}
  36. { needed for insert,delete,readln }
  37. {$P+}
  38. { stack checking always disabled
  39. for system unit. This is because
  40. the startup code might not
  41. have been called yet when we
  42. get a stack error, this will
  43. cause big crashes
  44. }
  45. {$S-}
  46. {****************************************************************************
  47. Global Types and Constants
  48. ****************************************************************************}
  49. { some values which are used in RTL for TSystemCodePage type }
  50. const
  51. CP_ACP = 0; // default to ANSI code page
  52. CP_OEMCP = 1; // default to OEM (console) code page
  53. CP_UTF16 = 1200; // utf-16
  54. CP_UTF16BE = 1201; // unicodeFFFE
  55. CP_UTF7 = 65000; // utf-7
  56. CP_UTF8 = 65001; // utf-8
  57. CP_ASCII = 20127; // us-ascii
  58. CP_NONE = $FFFF; // rawbytestring encoding
  59. Type
  60. { The compiler has all integer types defined internally. Here
  61. we define only aliases }
  62. DWord = LongWord;
  63. Cardinal = LongWord;
  64. Integer = SmallInt;
  65. UInt64 = QWord;
  66. { moved here from psystem.pas
  67. Delphi allows chose of overloaded procedure depending
  68. on Real <-> Double, so use type here, see also tw7425.pp (FK) }
  69. {$ifndef FPUNONE}
  70. Real = type Double;
  71. {$i genmathh.inc}
  72. {$endif}
  73. {$ifdef CPUI386}
  74. {$define CPU32}
  75. {$define DEFAULT_EXTENDED}
  76. {$define SUPPORT_SINGLE}
  77. {$define SUPPORT_DOUBLE}
  78. {$define SUPPORT_EXTENDED}
  79. {$define SUPPORT_COMP}
  80. {$ifndef FPUNONE}
  81. ValReal = Extended;
  82. {$endif}
  83. {$ifndef VER2_6}
  84. FarPointer = NearFsPointer;
  85. {$endif}
  86. {$endif CPUI386}
  87. {$ifdef CPUI8086}
  88. {$define CPU16}
  89. {$define DEFAULT_EXTENDED}
  90. {$define SUPPORT_SINGLE}
  91. {$define SUPPORT_DOUBLE}
  92. {$define SUPPORT_EXTENDED}
  93. {$define SUPPORT_COMP}
  94. {$ifndef FPUNONE}
  95. ValReal = Extended;
  96. {$endif}
  97. {$if defined(FPC_MM_TINY)}
  98. {$define FPC_X86_CODE_NEAR}
  99. {$define FPC_X86_DATA_NEAR}
  100. {$elseif defined(FPC_MM_SMALL)}
  101. {$define FPC_X86_CODE_NEAR}
  102. {$define FPC_X86_DATA_NEAR}
  103. {$elseif defined(FPC_MM_MEDIUM)}
  104. {$define FPC_X86_CODE_FAR}
  105. {$define FPC_X86_DATA_NEAR}
  106. {$elseif defined(FPC_MM_COMPACT)}
  107. {$define FPC_X86_CODE_NEAR}
  108. {$define FPC_X86_DATA_FAR}
  109. {$elseif defined(FPC_MM_LARGE)}
  110. {$define FPC_X86_CODE_FAR}
  111. {$define FPC_X86_DATA_FAR}
  112. {$elseif defined(FPC_MM_HUGE)}
  113. {$define FPC_X86_CODE_FAR}
  114. {$define FPC_X86_DATA_HUGE}
  115. {$else}
  116. {$fatal No memory model defined}
  117. {$endif}
  118. {$endif CPUI8086}
  119. {$ifdef CPUX86_64}
  120. {$ifdef FPC_HAS_TYPE_EXTENDED}
  121. { win64 doesn't support the legacy fpu }
  122. {$define DEFAULT_EXTENDED}
  123. {$define SUPPORT_EXTENDED}
  124. {$define SUPPORT_COMP}
  125. {$ifndef FPUNONE}
  126. ValReal = Extended;
  127. {$endif}
  128. {$else FPC_HAS_TYPE_EXTENDED}
  129. {$define DEFAULT_DOUBLE}
  130. {$ifndef FPUNONE}
  131. ValReal = Double;
  132. {$endif}
  133. { map comp to int64, but this doesn't mean we compile the comp support in! }
  134. Comp = Int64;
  135. PComp = ^Comp;
  136. {$endif FPC_HAS_TYPE_EXTENDED}
  137. {$define SUPPORT_SINGLE}
  138. {$define SUPPORT_DOUBLE}
  139. {$ifndef VER2_6}
  140. FarPointer = Pointer;
  141. {$endif}
  142. {$endif CPUX86_64}
  143. {$ifdef CPUM68K}
  144. {$define DEFAULT_DOUBLE}
  145. {$ifdef FPUSOFT}
  146. {$define FPC_INCLUDE_SOFTWARE_MOD_DIV}
  147. {$define FPC_INCLUDE_SOFTWARE_MUL}
  148. {$endif}
  149. { m68k int64 shl/shr uses soft helper for non constaznt values }
  150. {$define FPC_INCLUDE_SOFTWARE_SHIFT_INT64}
  151. {$define SUPPORT_SINGLE}
  152. {$define SUPPORT_DOUBLE}
  153. {$ifndef FPUNONE}
  154. ValReal = Real;
  155. {$endif}
  156. { Comp type does not exist on fpu }
  157. Comp = int64;
  158. PComp = ^Comp;
  159. FarPointer = Pointer;
  160. {$endif CPUM68K}
  161. {$ifdef CPUPOWERPC}
  162. {$define DEFAULT_DOUBLE}
  163. {$ifndef FPUNONE}
  164. {$define SUPPORT_SINGLE}
  165. {$define SUPPORT_DOUBLE}
  166. {$define FPC_INCLUDE_SOFTWARE_INT64_TO_DOUBLE}
  167. ValReal = Double;
  168. {$endif}
  169. { map comp to int64, but this doesn't mean we compile the comp support in! }
  170. Comp = Int64;
  171. PComp = ^Comp;
  172. FarPointer = Pointer;
  173. {$endif CPUPOWERPC}
  174. {$ifdef CPUSPARC}
  175. {$define DEFAULT_DOUBLE}
  176. {$define SUPPORT_SINGLE}
  177. {$define SUPPORT_DOUBLE}
  178. {$define FPC_INCLUDE_SOFTWARE_SHIFT_INT64}
  179. {$ifndef FPUNONE}
  180. ValReal = Double;
  181. {$endif}
  182. { map comp to int64, but this doesn't mean we compile the comp support in! }
  183. Comp = Int64;
  184. PComp = ^Comp;
  185. FarPointer = Pointer;
  186. {$endif CPUSPARC}
  187. {$if defined(CPUMIPS32) or defined(CPUMIPSEL32)}
  188. {$define DEFAULT_DOUBLE}
  189. {$define SUPPORT_SINGLE}
  190. {$define SUPPORT_DOUBLE}
  191. {$define FPC_INCLUDE_SOFTWARE_SHIFT_INT64}
  192. {$ifndef FPUNONE}
  193. {$define FPC_INCLUDE_SOFTWARE_INT64_TO_DOUBLE}
  194. ValReal = Double;
  195. {$endif}
  196. { map comp to int64, but this doesn't mean we compile the comp support in! }
  197. Comp = Int64;
  198. PComp = ^Comp;
  199. FarPointer = Pointer;
  200. {$endif CPUMIPS32}
  201. {$ifdef CPUARM}
  202. {$define DEFAULT_DOUBLE}
  203. {$define SUPPORT_SINGLE}
  204. {$define SUPPORT_DOUBLE}
  205. {$define FPC_INCLUDE_SOFTWARE_MOD_DIV}
  206. {$define FPC_INCLUDE_SOFTWARE_SHIFT_INT64}
  207. {$define FPC_INCLUDE_SOFTWARE_INT64_TO_DOUBLE}
  208. {$ifndef FPUNONE}
  209. ValReal = Real;
  210. {$endif}
  211. { map comp to int64, but this doesn't mean we compile the comp support in! }
  212. Comp = Int64;
  213. PComp = ^Comp;
  214. FarPointer = Pointer;
  215. {$endif CPUARM}
  216. {$ifdef CPUAVR}
  217. {$define DEFAULT_SINGLE}
  218. {$define FPC_INCLUDE_SOFTWARE_MOD_DIV}
  219. {$define FPC_INCLUDE_SOFTWARE_MUL}
  220. {$define FPC_INCLUDE_SOFTWARE_SHIFT_INT64}
  221. {$ifndef FPUNONE}
  222. {$define SUPPORT_SINGLE}
  223. {$define SUPPORT_DOUBLE}
  224. {$define FPC_INCLUDE_SOFTWARE_INT64_TO_DOUBLE}
  225. ValReal = Real;
  226. {$endif}
  227. { map comp to int64, but this doesn't mean we compile the comp support in! }
  228. Comp = Int64;
  229. PComp = ^Comp;
  230. FarPointer = Pointer;
  231. {$endif CPUAVR}
  232. {$ifdef CPUJVM}
  233. {$define DEFAULT_DOUBLE}
  234. {$define SUPPORT_SINGLE}
  235. {$define SUPPORT_DOUBLE}
  236. ValReal = Double;
  237. { map comp to int64, but this doesn't mean we compile the comp support in! }
  238. Comp = Int64;
  239. PComp = ^Comp;
  240. {$endif CPUJVM}
  241. {$ifdef CPU64}
  242. SizeInt = Int64;
  243. SizeUInt = QWord;
  244. PtrInt = Int64;
  245. PtrUInt = QWord;
  246. ValSInt = int64;
  247. ValUInt = qword;
  248. CodePointer = Pointer;
  249. CodePtrInt = PtrInt;
  250. CodePtrUInt = PtrUInt;
  251. {$endif CPU64}
  252. {$ifdef CPU32}
  253. SizeInt = Longint;
  254. SizeUInt = DWord;
  255. PtrInt = Longint;
  256. PtrUInt = DWord;
  257. ValSInt = Longint;
  258. ValUInt = Cardinal;
  259. CodePointer = Pointer;
  260. CodePtrInt = PtrInt;
  261. CodePtrUInt = PtrUInt;
  262. {$endif CPU32}
  263. {$ifdef CPU16}
  264. SizeInt = Integer;
  265. SizeUInt = Word;
  266. {$if defined(FPC_X86_DATA_FAR) or defined(FPC_X86_DATA_HUGE)}
  267. PtrInt = Longint;
  268. PtrUInt = DWord;
  269. {$else}
  270. PtrInt = Integer;
  271. PtrUInt = Word;
  272. {$endif}
  273. {$if defined(FPC_X86_CODE_FAR)}
  274. CodePointer = FarPointer;
  275. CodePtrInt = Longint;
  276. CodePtrUInt = DWord;
  277. {$elseif defined(FPC_X86_CODE_NEAR)}
  278. CodePointer = NearPointer;
  279. CodePtrInt = Integer;
  280. CodePtrUInt = Word;
  281. {$else}
  282. CodePointer = Pointer;
  283. CodePtrInt = PtrInt;
  284. CodePtrUInt = PtrUInt;
  285. {$endif}
  286. ValSInt = Integer;
  287. ValUInt = Word;
  288. {$endif CPU16}
  289. {$if defined(CPUINT8)}
  290. ALUSInt = ShortInt;
  291. ALUUInt = Byte;
  292. {$elseif defined(CPUINT16)}
  293. ALUSInt = SmallInt;
  294. ALUUInt = Word;
  295. {$elseif defined(CPUINT32)}
  296. ALUSInt = Longint;
  297. ALUUInt = DWord;
  298. {$elseif defined(CPUINT64)}
  299. ALUSInt = Int64;
  300. ALUUInt = QWord;
  301. {$endif defined(CPUINT64)}
  302. { NativeInt and NativeUInt are Delphi compatibility types. Even though Delphi
  303. has IntPtr and UIntPtr, the Delphi documentation for NativeInt states that
  304. 'The size of NativeInt is equivalent to the size of the pointer on the
  305. current platform'. Because of the misleading names, these types shouldn't be
  306. used in the FPC RTL. Note that on i8086 their size changes between 16-bit
  307. and 32-bit according to the memory model, so they're not really a 'native
  308. int' type there at all. }
  309. NativeInt = PtrInt;
  310. NativeUInt = PtrUInt;
  311. Int8 = ShortInt;
  312. Int16 = SmallInt;
  313. Int32 = Longint;
  314. IntPtr = PtrInt;
  315. UInt8 = Byte;
  316. UInt16 = Word;
  317. UInt32 = Cardinal;
  318. UIntPtr = PtrUInt;
  319. {$IF DECLARED(AnsiChar)}
  320. // Compiler defines AnsiChar and WideChar, not AnsiChar
  321. {$IFDEF UNICODERTL}
  322. Char = WideChar;
  323. {$ElSE}
  324. Char = AnsiChar;
  325. {$ENDIF}
  326. {$ELSE}
  327. // Compiler defines Char, we make AnsiChar an alias
  328. AnsiChar = char;
  329. {$ENDIF}
  330. { Zero - terminated strings }
  331. // Ansichar is the basic type
  332. TAnsiChar = AnsiChar;
  333. PAnsiChar = ^AnsiChar;
  334. PPAnsiChar = ^PAnsiChar;
  335. PPPAnsiChar = ^PPAnsiChar;
  336. // Char is an alias
  337. PChar = ^Char;
  338. PPChar = ^PChar;
  339. PPPChar = ^PPChar;
  340. UCS4Char = 0..$10ffff;
  341. PUCS4Char = ^UCS4Char;
  342. {$ifdef CPU16}
  343. TUCS4CharArray = array[0..32767 div sizeof(UCS4Char)-1] of UCS4Char;
  344. {$else CPU16}
  345. TUCS4CharArray = array[0..$effffff] of UCS4Char;
  346. {$endif CPU16}
  347. PUCS4CharArray = ^TUCS4CharArray;
  348. UCS4String = array of UCS4Char;
  349. UTF8String = type AnsiString(CP_UTF8);
  350. PUTF8String = ^UTF8String;
  351. RawByteString = type AnsiString(CP_NONE);
  352. HRESULT = type Longint;
  353. {$ifndef FPUNONE}
  354. TDateTime = type Double;
  355. TDate = type TDateTime;
  356. TTime = type TDateTime;
  357. {$endif}
  358. TError = type Longint;
  359. {$ifndef FPUNONE}
  360. PSingle = ^Single;
  361. PDouble = ^Double;
  362. PExtended = ^Extended;
  363. PPDouble = ^PDouble;
  364. {$endif}
  365. PCurrency = ^Currency;
  366. {$ifdef SUPPORT_COMP}
  367. PComp = ^Comp;
  368. {$endif SUPPORT_COMP}
  369. PSmallInt = ^Smallint;
  370. PShortInt = ^Shortint;
  371. PInteger = ^Integer;
  372. PByte = ^Byte;
  373. PWord = ^word;
  374. PDWord = ^DWord;
  375. PLongWord = ^LongWord;
  376. PLongint = ^Longint;
  377. PCardinal = ^Cardinal;
  378. PQWord = ^QWord;
  379. PInt64 = ^Int64;
  380. PPtrInt = ^PtrInt;
  381. PPtrUInt = ^PtrUInt;
  382. PSizeInt = ^SizeInt;
  383. PPByte = ^PByte;
  384. PPLongint = ^PLongint;
  385. PPointer = ^Pointer;
  386. PPPointer = ^PPointer;
  387. PCodePointer = ^CodePointer;
  388. PPCodePointer = ^PCodePointer;
  389. PBoolean = ^Boolean;
  390. PWordBool = ^WordBool;
  391. PLongBool = ^LongBool;
  392. PNativeInt = ^NativeInt;
  393. PNativeUInt = ^NativeUint;
  394. pInt8 = PShortInt;
  395. pInt16 = PSmallint;
  396. pInt32 = PLongint;
  397. PIntPtr = PPtrInt;
  398. pUInt8 = PByte;
  399. pUInt16 = PWord;
  400. pUInt32 = PDWord;
  401. PUintPtr = PPtrUInt;
  402. PShortString = ^ShortString;
  403. PAnsiString = ^AnsiString;
  404. {$ifndef FPUNONE}
  405. PDate = ^TDateTime;
  406. PDateTime = ^TDateTime;
  407. {$endif}
  408. PError = ^TError;
  409. {$ifdef FPC_HAS_FEATURE_VARIANTS}
  410. PVariant = ^Variant;
  411. POleVariant = ^OleVariant;
  412. {$endif FPC_HAS_FEATURE_VARIANTS}
  413. PWideChar = ^WideChar;
  414. PPWideChar = ^PWideChar;
  415. PPPWideChar = ^PPWideChar;
  416. WChar = Widechar;
  417. UCS2Char = WideChar;
  418. PUCS2Char = PWideChar;
  419. PWideString = ^WideString;
  420. UnicodeChar = WideChar;
  421. PUnicodeChar = ^UnicodeChar;
  422. PUnicodeString = ^UnicodeString;
  423. TSystemCodePage = Word;
  424. {$ifdef VER2_6}
  425. { the size of textrec/filerec is hardcoded in the 2.6 compiler binary }
  426. {$define FPC_ANSI_TEXTFILEREC}
  427. {$endif}
  428. TFileTextRecChar = {$if defined(FPC_ANSI_TEXTFILEREC) or not(defined(FPC_HAS_FEATURE_WIDESTRINGS))}AnsiChar{$else}UnicodeChar{$endif};
  429. PFileTextRecChar = ^TFileTextRecChar;
  430. TTextLineBreakStyle = (tlbsLF,tlbsCRLF,tlbsCR);
  431. { procedure type }
  432. TProcedure = Procedure;
  433. { platform-dependent types }
  434. {$i sysosh.inc}
  435. { platform-dependent defines }
  436. {$i rtldefs.inc}
  437. (*
  438. {*****************************************************************************
  439. TextRec/FileRec exported to allow compiler to take size
  440. *****************************************************************************}
  441. {$ifdef FPC_HAS_FEATURE_FILEIO}
  442. {$i filerec.inc}
  443. {$endif FPC_HAS_FEATURE_FILEIO}
  444. {$i textrec.inc}
  445. type
  446. { Needed for fpc_get_output }
  447. PText = ^Text;
  448. TEntryInformation = record
  449. InitFinalTable : Pointer;
  450. ThreadvarTablesTable : Pointer;
  451. ResourceStringTables : Pointer;
  452. ResStrInitTables : Pointer;
  453. ResLocation : Pointer;
  454. PascalMain : Procedure;
  455. valgrind_used : boolean;
  456. {$ifdef HAS_ENTRYINFORMATION_OS}
  457. OS : TEntryInformationOS;
  458. {$endif HAS_ENTRYINFORMATION_OS}
  459. end;
  460. *)
  461. const
  462. { Maximum value of the biggest signed and unsigned integer type available}
  463. MaxSIntValue = High(ValSInt);
  464. MaxUIntValue = High(ValUInt);
  465. { max. values for longint and int}
  466. maxLongint = $7fffffff;
  467. maxSmallint = 32767;
  468. maxint = maxsmallint;
  469. type
  470. {$ifdef CPU16}
  471. IntegerArray = array[0..maxSmallint div sizeof(Integer)-1] of Integer;
  472. {$else CPU16}
  473. IntegerArray = array[0..$effffff] of Integer;
  474. {$endif CPU16}
  475. PIntegerArray = ^IntegerArray;
  476. {$ifdef CPU16}
  477. PointerArray = array [0..32767 div sizeof(Pointer)-1] of Pointer;
  478. {$else CPU16}
  479. PointerArray = array [0..512*1024*1024-2] of Pointer;
  480. {$endif CPU16}
  481. (*
  482. PPointerArray = ^PointerArray;
  483. *)
  484. TBoundArray = array of SizeInt;
  485. (*
  486. {$ifdef CPU16}
  487. TPCharArray = packed array[0..(MaxSmallint div SizeOf(PAnsiChar))-1] of PAnsiChar;
  488. {$else CPU16}
  489. TPCharArray = packed array[0..(MaxLongint div SizeOf(PAnsiChar))-1] of PAnsiChar;
  490. {$endif CPU16}
  491. PPCharArray = ^TPCharArray;
  492. *)
  493. (* CtrlBreak set to true signalizes Ctrl-Break signal, otherwise Ctrl-C. *)
  494. (* Return value of true means that the signal has been processed, false *)
  495. (* means that default handling should be used. *)
  496. (*
  497. TCtrlBreakHandler = function (CtrlBreak: boolean): boolean;
  498. *)
  499. const
  500. {$ifdef cpui386}
  501. { Always i386 or newer }
  502. Test8086 : byte = 2;
  503. { Always 387 or newer. Emulated if needed. }
  504. Test8087 : byte = 3;
  505. { will be detected at startup }
  506. has_sse_support : boolean = false;
  507. has_sse2_support : boolean = false;
  508. has_sse3_support : boolean = false;
  509. has_mmx_support : boolean = false;
  510. {$endif cpui386}
  511. {$ifdef cpui8086}
  512. { will be detected at startup }
  513. { 0=8086/8088/80186/80188/NEC V20/NEC V30, 1=80286, 2=80386 or newer }
  514. Test8086 : byte = 0; public name '__Test8086';
  515. { will be detected at startup }
  516. { 0=NO FPU, 1=8087, 2=80287, 3=80387 or newer }
  517. Test8087 : byte = 0;
  518. { will be detected at startup }
  519. has_sse_support : boolean = false;
  520. has_mmx_support : boolean = false;
  521. {$endif cpui8086}
  522. {$ifdef cpum68k}
  523. Test68000 : byte = 0; { Must be determined at startup for both }
  524. Test68881 : byte = 0;
  525. {$endif cpum68k}
  526. { max level in dumping on error }
  527. Max_Frame_Dump : Word = 8;
  528. (*
  529. { Exit Procedure handling consts and types }
  530. ExitProc : codepointer = nil;
  531. Erroraddr: codepointer = nil;
  532. *)
  533. Errorcode: Word = 0;
  534. { file input modes }
  535. fmClosed = $D7B0;
  536. fmInput = $D7B1;
  537. fmOutput = $D7B2;
  538. fmInOut = $D7B3;
  539. fmAppend = $D7B4;
  540. Filemode : byte = 2;
  541. (* Value should be changed during system initialization as appropriate. *)
  542. { assume that this program will not spawn other threads, when the
  543. first thread is started the following constants need to be filled }
  544. IsMultiThread : longbool = FALSE;
  545. { set to true, if a threading helper is used before a thread
  546. manager has been installed }
  547. ThreadingAlreadyUsed : boolean = FALSE;
  548. { Indicates if there was an error }
  549. StackError : boolean = FALSE;
  550. (*
  551. InitProc : CodePointer = nil;
  552. *)
  553. { compatibility }
  554. ModuleIsLib : Boolean = FALSE;
  555. ModuleIsPackage : Boolean = FALSE;
  556. ModuleIsCpp : Boolean = FALSE;
  557. var
  558. ExitCode : Longint; (* public name 'operatingsystem_result'; *)
  559. RandSeed : Cardinal;
  560. { Delphi compatibility }
  561. {$ifdef FPC_HAS_FEATURE_DYNLIBS}
  562. IsLibrary : boolean = false; public name 'operatingsystem_islibrary';
  563. {$else FPC_HAS_FEATURE_DYNLIBS}
  564. const
  565. IsLibrary = false;
  566. var
  567. {$endif FPC_HAS_FEATURE_DYNLIBS}
  568. IsConsole : boolean = false; public name 'operatingsystem_isconsole';
  569. NoErrMsg: Boolean platform = False; // For Delphi compatibility, not used in FPC.
  570. FirstDotAtFileNameStartIsExtension : Boolean = False;
  571. DefaultSystemCodePage,
  572. DefaultUnicodeCodePage,
  573. { the code page to use when sending paths/file names to OS file system API
  574. calls using single byte strings, and to interpret the results gotten back
  575. from such API calls }
  576. DefaultFileSystemCodePage,
  577. { the code page to use to return file names from single byte file system calls
  578. in the RTL that return ansistrings (by default, same as a above) }
  579. DefaultRTLFileSystemCodePage,
  580. UTF8CompareLocale : TSystemCodePage;
  581. (*
  582. {$ifndef HAS_CMDLINE}
  583. {Value should be changed during system initialization as appropriate.}
  584. var cmdline:PAnsiChar=nil;
  585. {$endif}
  586. *)
  587. (*
  588. {$ifdef FPC_HAS_FEATURE_THREADING}
  589. ThreadVar
  590. {$else FPC_HAS_FEATURE_THREADING}
  591. Var
  592. {$endif FPC_HAS_FEATURE_THREADING}
  593. ThreadID : TThreadID;
  594. { Standard In- and Output }
  595. ErrOutput,
  596. Output,
  597. Input,
  598. StdOut,
  599. StdErr : Text;
  600. InOutRes : Word;
  601. { Stack checking }
  602. StackBottom : Pointer;
  603. StackLength : SizeUInt;
  604. function StackTop: Pointer;
  605. *)
  606. { Numbers for routines that have compiler magic }
  607. {$I innr.inc}