jsystemh_types.inc 18 KB

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