objpash.inc 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 1999-2005 by the Free Pascal development team
  4. This unit makes Free Pascal as much as possible Delphi compatible,
  5. defining several internal structures for classes, interfaces, and
  6. resource strings.
  7. Additionally this file defines the interface of TObject, providing
  8. their basic implementation in the corresponding objpas.inc file.
  9. WARNING: IF YOU CHANGE SOME OF THESE INTERNAL RECORDS, MAKE SURE
  10. TO MODIFY THE COMPILER AND OBJPAS.INC ACCORDINGLY, OTHERWISE
  11. THIS WILL LEAD TO CRASHES IN THE RESULTING COMPILER AND/OR RTL.
  12. IN PARTICULAR, THE IMPLEMENTATION PART OF THIS INCLUDE FILE,
  13. OBJPAS.INC, USES SOME HARDCODED RECORD MEMBER OFFSETS.
  14. See the file COPYING.FPC, included in this distribution,
  15. for details about the copyright.
  16. This program is distributed in the hope that it will be useful,
  17. but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  19. **********************************************************************}
  20. {*****************************************************************************
  21. Basic Types/constants
  22. *****************************************************************************}
  23. type
  24. TextFile = Text;
  25. PGuid = ^TGuid;
  26. TGuid = packed record
  27. case integer of
  28. 1 : (
  29. Data1 : DWord;
  30. Data2 : word;
  31. Data3 : word;
  32. Data4 : array[0..7] of byte;
  33. );
  34. 2 : (
  35. D1 : DWord;
  36. D2 : word;
  37. D3 : word;
  38. D4 : array[0..7] of byte;
  39. );
  40. 3 : ( { uuid fields according to RFC4122 }
  41. time_low : dword; // The low field of the timestamp
  42. time_mid : word; // The middle field of the timestamp
  43. time_hi_and_version : word; // The high field of the timestamp multiplexed with the version number
  44. clock_seq_hi_and_reserved : byte; // The high field of the clock sequence multiplexed with the variant
  45. clock_seq_low : byte; // The low field of the clock sequence
  46. node : array[0..5] of byte; // The spatially unique node identifier
  47. );
  48. end;
  49. {$ifdef FPC_HAS_FEATURE_CLASSES}
  50. const
  51. vmtInstanceSize = 0;
  52. vmtParent = sizeof(SizeInt)*2;
  53. { These were negative value's, but are now positive, else classes
  54. couldn't be used with shared linking which copies only all data from
  55. the .global directive and not the data before the directive (PFV) }
  56. vmtClassName = vmtParent+sizeof(pointer);
  57. vmtDynamicTable = vmtParent+sizeof(pointer)*2;
  58. vmtMethodTable = vmtParent+sizeof(pointer)*3;
  59. vmtFieldTable = vmtParent+sizeof(pointer)*4;
  60. vmtTypeInfo = vmtParent+sizeof(pointer)*5;
  61. vmtInitTable = vmtParent+sizeof(pointer)*6;
  62. vmtAutoTable = vmtParent+sizeof(pointer)*7;
  63. vmtIntfTable = vmtParent+sizeof(pointer)*8;
  64. vmtMsgStrPtr = vmtParent+sizeof(pointer)*9;
  65. { methods }
  66. vmtMethodStart = vmtParent+sizeof(pointer)*10;
  67. vmtDestroy = vmtMethodStart;
  68. vmtNewInstance = vmtMethodStart+sizeof(codepointer);
  69. vmtFreeInstance = vmtMethodStart+sizeof(codepointer)*2;
  70. vmtSafeCallException = vmtMethodStart+sizeof(codepointer)*3;
  71. vmtDefaultHandler = vmtMethodStart+sizeof(codepointer)*4;
  72. vmtAfterConstruction = vmtMethodStart+sizeof(codepointer)*5;
  73. vmtBeforeDestruction = vmtMethodStart+sizeof(codepointer)*6;
  74. vmtDefaultHandlerStr = vmtMethodStart+sizeof(codepointer)*7;
  75. vmtDispatch = vmtMethodStart+sizeof(codepointer)*8;
  76. vmtDispatchStr = vmtMethodStart+sizeof(codepointer)*9;
  77. vmtEquals = vmtMethodStart+sizeof(codepointer)*10;
  78. vmtGetHashCode = vmtMethodStart+sizeof(codepointer)*11;
  79. vmtToString = vmtMethodStart+sizeof(codepointer)*12;
  80. { IInterface }
  81. S_OK = 0;
  82. S_FALSE = 1;
  83. E_NOINTERFACE = hresult($80004002);
  84. E_UNEXPECTED = hresult($8000FFFF);
  85. E_NOTIMPL = hresult($80004001);
  86. type
  87. { now the let's declare the base classes for the class object
  88. model. The compiler expects TObject and IUnknown to be defined
  89. first as forward classes }
  90. TObject = class;
  91. IUnknown = interface;
  92. TClass = class of tobject;
  93. PClass = ^tclass;
  94. { to access the message table from outside }
  95. TMsgStrTable = record
  96. name : pshortstring;
  97. method : codepointer;
  98. end;
  99. PMsgStrTable = ^TMsgStrTable;
  100. TStringMessageTable = record
  101. count : longint;
  102. msgstrtable : array[0..0] of tmsgstrtable;
  103. end;
  104. pstringmessagetable = ^tstringmessagetable;
  105. pinterfacetable = ^tinterfacetable;
  106. PVmt = ^TVmt;
  107. PPVmt = ^PVmt;
  108. TVmt = record
  109. vInstanceSize: SizeInt;
  110. vInstanceSize2: SizeInt;
  111. vParentRef: {$ifdef VER3_0}PVmt{$else}PPVmt{$endif};
  112. vClassName: PShortString;
  113. vDynamicTable: Pointer;
  114. vMethodTable: Pointer;
  115. vFieldTable: Pointer;
  116. vTypeInfo: Pointer;
  117. vInitTable: Pointer;
  118. vAutoTable: Pointer;
  119. vIntfTable: PInterfaceTable;
  120. vMsgStrPtr: pstringmessagetable;
  121. vDestroy: CodePointer;
  122. vNewInstance: CodePointer;
  123. vFreeInstance: CodePointer;
  124. vSafeCallException: CodePointer;
  125. vDefaultHandler: CodePointer;
  126. vAfterConstruction: CodePointer;
  127. vBeforeDestruction: CodePointer;
  128. vDefaultHandlerStr: CodePointer;
  129. vDispatch: CodePointer;
  130. vDispatchStr: CodePointer;
  131. vEquals: CodePointer;
  132. vGetHashCode: CodePointer;
  133. vToString: CodePointer;
  134. private
  135. function GetvParent: PVmt; inline;
  136. public
  137. property vParent: PVmt read GetvParent;
  138. end;
  139. // This enumerate is found both in the rtl and compiler. Do not change the order of the fields.
  140. tinterfaceentrytype = (etStandard,
  141. etVirtualMethodResult,
  142. etStaticMethodResult,
  143. etFieldValue,
  144. etVirtualMethodClass,
  145. etStaticMethodClass,
  146. etFieldValueClass
  147. );
  148. pinterfaceentry = ^tinterfaceentry;
  149. tinterfaceentry = record
  150. private
  151. function GetIID: pguid; inline;
  152. function GetIIDStr: pshortstring; inline;
  153. public
  154. property IID: pguid read GetIID;
  155. property IIDStr: pshortstring read GetIIDStr;
  156. public
  157. IIDRef : {$IFNDEF VER3_0}^{$ENDIF}pguid; { if assigned(IID) then Com else Corba}
  158. VTable : Pointer;
  159. case integer of
  160. 1 : (
  161. IOffset: sizeuint;
  162. );
  163. 2 : (
  164. IOffsetAsCodePtr: CodePointer;
  165. IIDStrRef : {$IFNDEF VER3_0}^{$ENDIF}pshortstring; { never nil. Com: upper(GuidToString(IID^)) }
  166. IType : tinterfaceentrytype;
  167. );
  168. end;
  169. tinterfacetable = record
  170. EntryCount : sizeuint;
  171. Entries : array[0..0] of tinterfaceentry;
  172. end;
  173. PMethod = ^TMethod;
  174. TMethod = record
  175. Code : CodePointer;
  176. Data : Pointer;
  177. end;
  178. TObject = class
  179. public
  180. { please don't change the order of virtual methods, because
  181. their vmt offsets are used by some assembler code which uses
  182. hard coded addresses (FK) }
  183. constructor Create;
  184. { the virtual procedures must be in THAT order }
  185. destructor Destroy;virtual;
  186. class function newinstance : tobject;virtual;
  187. procedure FreeInstance;virtual;
  188. function SafeCallException(exceptobject : tobject;
  189. exceptaddr : codepointer) : HResult;virtual;
  190. procedure DefaultHandler(var message);virtual;
  191. procedure Free;
  192. class function InitInstance(instance : pointer) : tobject;
  193. procedure CleanupInstance;
  194. class function ClassType : tclass;{$ifdef SYSTEMINLINE}inline;{$endif}
  195. class function ClassInfo : pointer;
  196. class function ClassName : shortstring;
  197. class function ClassNameIs(const name : string) : boolean;
  198. class function ClassParent : tclass;{$ifdef SYSTEMINLINE}inline;{$endif}
  199. class function InstanceSize : SizeInt;{$ifdef SYSTEMINLINE}inline;{$endif}
  200. class function InheritsFrom(aclass : tclass) : boolean;
  201. class function StringMessageTable : pstringmessagetable;
  202. class function MethodAddress(const name : shortstring) : codepointer;
  203. class function MethodName(address : codepointer) : shortstring;
  204. function FieldAddress(const name : shortstring) : pointer;
  205. { new since Delphi 4 }
  206. procedure AfterConstruction;virtual;
  207. procedure BeforeDestruction;virtual;
  208. { new for gtk, default handler for text based messages }
  209. procedure DefaultHandlerStr(var message);virtual;
  210. { message handling routines }
  211. procedure Dispatch(var message);virtual;
  212. procedure DispatchStr(var message);virtual;
  213. { interface functions }
  214. function GetInterface(const iid : tguid; out obj) : boolean;
  215. function GetInterface(const iidstr : shortstring;out obj) : boolean;
  216. function GetInterfaceByStr(const iidstr : shortstring; out obj) : boolean;
  217. function GetInterfaceWeak(const iid : tguid; out obj) : boolean; // equal to GetInterface but the interface returned is not referenced
  218. class function GetInterfaceEntry(const iid : tguid) : pinterfaceentry;
  219. class function GetInterfaceEntryByStr(const iidstr : shortstring) : pinterfaceentry;
  220. class function GetInterfaceTable : pinterfacetable;
  221. { new since Delphi 2009 }
  222. class function UnitName : {$ifdef FPC_HAS_FEATURE_ANSISTRINGS}ansistring{$else FPC_HAS_FEATURE_ANSISTRINGS}shortstring{$endif FPC_HAS_FEATURE_ANSISTRINGS};
  223. class function QualifiedClassName: {$ifdef FPC_HAS_FEATURE_ANSISTRINGS}ansistring{$else FPC_HAS_FEATURE_ANSISTRINGS}shortstring{$endif FPC_HAS_FEATURE_ANSISTRINGS};
  224. function Equals(Obj: TObject) : boolean;virtual;
  225. function GetHashCode: PtrInt;virtual;
  226. function ToString: {$ifdef FPC_HAS_FEATURE_ANSISTRINGS}ansistring{$else FPC_HAS_FEATURE_ANSISTRINGS}shortstring{$endif FPC_HAS_FEATURE_ANSISTRINGS};virtual;
  227. end;
  228. IUnknown = interface
  229. ['{00000000-0000-0000-C000-000000000046}']
  230. function QueryInterface({$IFDEF FPC_HAS_CONSTREF}constref{$ELSE}const{$ENDIF} iid : tguid;out obj) : longint;{$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
  231. function _AddRef : longint;{$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
  232. function _Release : longint;{$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
  233. end;
  234. IInterface = IUnknown;
  235. {$M+}
  236. IInvokable = interface(IInterface)
  237. end;
  238. {$M-}
  239. { enumerator support }
  240. IEnumerator = interface(IInterface)
  241. function GetCurrent: TObject;
  242. function MoveNext: Boolean;
  243. procedure Reset;
  244. property Current: TObject read GetCurrent;
  245. end;
  246. IEnumerable = interface(IInterface)
  247. function GetEnumerator: IEnumerator;
  248. end;
  249. { for native dispinterface support }
  250. IDispatch = interface(IUnknown)
  251. ['{00020400-0000-0000-C000-000000000046}']
  252. function GetTypeInfoCount(out count : longint) : HResult;stdcall;
  253. function GetTypeInfo(Index,LocaleID : longint;
  254. out TypeInfo): HResult;stdcall;
  255. function GetIDsOfNames(const iid: TGUID; names: Pointer;
  256. NameCount, LocaleID: LongInt; DispIDs: Pointer) : HResult;stdcall;
  257. function Invoke(DispID: LongInt;const iid : TGUID;
  258. LocaleID : longint; Flags: Word;var params;
  259. VarResult,ExcepInfo,ArgErr : pointer) : HResult;stdcall;
  260. end;
  261. { TInterfacedObject }
  262. TInterfacedObject = class(TObject,IUnknown)
  263. protected
  264. FRefCount : longint;
  265. FDestroyCount : longint;
  266. { implement methods of IUnknown }
  267. function QueryInterface({$IFDEF FPC_HAS_CONSTREF}constref{$ELSE}const{$ENDIF} iid : tguid;out obj) : longint;{$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
  268. function _AddRef : longint;{$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
  269. function _Release : longint;{$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
  270. public
  271. destructor Destroy; override;
  272. procedure AfterConstruction;override;
  273. procedure BeforeDestruction;override;
  274. class function NewInstance : TObject;override;
  275. property RefCount : longint read FRefCount;
  276. end;
  277. TInterfacedClass = class of TInterfacedObject;
  278. TAggregatedObject = class(TObject)
  279. private
  280. fcontroller: Pointer;
  281. function GetController: IUnknown;
  282. protected
  283. { implement methods of IUnknown }
  284. function QueryInterface({$IFDEF FPC_HAS_CONSTREF}constref{$ELSE}const{$ENDIF} iid : tguid;out obj) : longint;{$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
  285. function _AddRef : longint;{$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
  286. function _Release : longint;{$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
  287. public
  288. constructor Create(const aController: IUnknown);
  289. property Controller : IUnknown read GetController;
  290. end;
  291. TContainedObject = class(TAggregatedObject,IInterface)
  292. protected
  293. function QueryInterface({$IFDEF FPC_HAS_CONSTREF}constref{$ELSE}const{$ENDIF} iid : tguid;out obj) : longint;virtual; {$IFNDEF WINDOWS}cdecl{$ELSE}stdcall{$ENDIF};
  294. end;
  295. { some pointer definitions }
  296. PUnknown = ^IUnknown;
  297. PPUnknown = ^PUnknown;
  298. PDispatch = ^IDispatch;
  299. PPDispatch = ^PDispatch;
  300. PInterface = PUnknown;
  301. {$ifdef FPC_USE_PSABIEH}
  302. {$if (defined(CPUARMEL) or defined(CPUARMHF)) and not defined(darwin)}
  303. {$define __ARM_EABI_UNWINDER__}
  304. {$endif}
  305. { needed here for TExceptObject (rest is in psabiehh.inc) }
  306. FPC_Unwind_Reason_Code = longint; {cint}
  307. FPC_Unwind_Action = longint; {cint}
  308. {$ifdef __ARM_EABI_UNWINDER__}
  309. FPC_Unwind_State = longint; {cint}
  310. {$endif}
  311. PFPC_Unwind_Exception = ^FPC_Unwind_Exception;
  312. FPC_Unwind_Exception_Cleanup_Fn =
  313. procedure(reason: FPC_Unwind_Reason_Code; exc: PFPC_Unwind_Exception); cdecl;
  314. FPC_Unwind_Exception = record
  315. { qword instead of array of char to ensure proper alignment and
  316. padding, and also easier to compare }
  317. exception_class: qword;
  318. exception_cleanup: FPC_Unwind_Exception_Cleanup_Fn;
  319. {$ifdef __ARM_EABI_UNWINDER__}
  320. { rest of UCB }
  321. // Unwinder cache, private fields for the unwinder's use
  322. unwinder_cache: record
  323. reserved1, // init reserved1 to 0, then don't touch
  324. reserved2,
  325. reserved3,
  326. reserved4,
  327. reserved5: UInt32;
  328. end;
  329. // Propagation barrier cache (valid after phase 1):
  330. barrier_cache: record
  331. sp: PtrUInt;
  332. bitpattern: array[0..4] of UInt32;
  333. end;
  334. // Cleanup cache (preserved over cleanup):
  335. cleanup_cache: record
  336. bitpattern: array[0..3] of UInt32;
  337. end;
  338. // Pr cache (for pr's benefit):
  339. pr_cache: record
  340. fnstart: UInt32; // function start address
  341. ehtp: pointer; // pointer to EHT entry header word
  342. additional: UInt32; // additional data
  343. reserved1: UInt32;
  344. end;
  345. {$else}
  346. private_1: ptruint;
  347. private_2: ptruint;
  348. private_3: ptruint;
  349. private_4: ptruint;
  350. private_5: ptruint;
  351. private_6: ptruint;
  352. {$endif}
  353. end;
  354. {$endif FPC_USE_PSABIEH}
  355. TExceptProc = Procedure (Obj : TObject; Addr : CodePointer; FrameCount:Longint; Frame: PCodePointer);
  356. { Exception object stack }
  357. PExceptObject = ^TExceptObject;
  358. TExceptObject = record
  359. FObject : TObject;
  360. Addr : codepointer;
  361. Next : PExceptObject;
  362. refcount : Longint;
  363. Framecount : Longint;
  364. Frames : PCodePointer;
  365. {$ifdef FPC_USE_WIN32_SEH}
  366. SEHFrame : Pointer;
  367. ExceptRec : Pointer;
  368. ReraiseBuf : jmp_buf;
  369. {$endif FPC_USE_WIN32_SEH}
  370. {$ifdef FPC_USE_PSABIEH}
  371. {$ifndef __ARM_EABI_UNWINDER__}
  372. { cached info from unwind phase for action phase }
  373. handler_switch_value: longint;
  374. language_specific_data: PByte;
  375. landing_pad: PtrUInt;
  376. {$endif __ARM_EABI_UNWINDER__}
  377. { libunwind exception handling data (must be last!) }
  378. unwind_exception: FPC_Unwind_Exception;
  379. {$endif FPC_USE_PSABIEH}
  380. end;
  381. {$PUSH}
  382. { disable the warning that the constructor should be public }
  383. {$WARN 3018 OFF}
  384. TCustomAttribute = class(TObject)
  385. private
  386. { if the user wants to use a parameterless constructor they need to
  387. explicitely declare it in their type }
  388. constructor Create;
  389. end;
  390. {$POP}
  391. WeakAttribute = class(TCustomAttribute);
  392. UnsafeAttribute = class(TCustomAttribute);
  393. RefAttribute = class(TCustomAttribute);
  394. VolatileAttribute = class(TCustomAttribute);
  395. StoredAttribute = Class(TCustomAttribute)
  396. Private
  397. FFlag : Boolean;
  398. FName : String;
  399. Public
  400. Constructor Create;
  401. Constructor Create(Const aFlag : Boolean);
  402. Constructor Create(Const aName : String);
  403. Property Flag : Boolean Read FFlag;
  404. Property Name : String Read FName;
  405. end;
  406. Const
  407. ExceptProc : TExceptProc = Nil;
  408. RaiseProc : TExceptProc = Nil;
  409. RaiseMaxFrameCount : Longint = 16;
  410. Function RaiseList : PExceptObject;
  411. { @abstract(increase exception reference count)
  412. When leaving an except block, the exception object is normally
  413. freed automatically. To avoid this, call this function.
  414. If within the exception object you decide that you don't need
  415. the exception after all, call @link(ReleaseExceptionObject).
  416. Otherwise, if the reference count is > 0, the exception object
  417. goes into your "property" and you need to free it manually.
  418. The effect of this function is countered by re-raising an exception
  419. via "raise;", this zeroes the reference count again.
  420. Calling this method is only valid within an except block.
  421. @return(pointer to the exception object) }
  422. function AcquireExceptionObject: Pointer;
  423. { @abstract(decrease exception reference count)
  424. After calling @link(AcquireExceptionObject) you can call this method
  425. to decrease the exception reference count again.
  426. If the reference count is > 0, the exception object
  427. goes into your "property" and you need to free it manually.
  428. Calling this method is only valid within an except block. }
  429. procedure ReleaseExceptionObject;
  430. const
  431. { for safe as operator support }
  432. IObjectInstance: TGuid = '{D91C9AF4-3C93-420F-A303-BF5BA82BFD23}';
  433. {$endif FPC_HAS_FEATURE_CLASSES}
  434. {*****************************************************************************
  435. Array of const support
  436. *****************************************************************************}
  437. const
  438. vtInteger = 0;
  439. vtBoolean = 1;
  440. vtChar = 2;
  441. {$ifndef FPUNONE}
  442. vtExtended = 3;
  443. {$endif}
  444. vtString = 4;
  445. vtPointer = 5;
  446. vtPChar = 6;
  447. vtObject = 7;
  448. vtClass = 8;
  449. vtWideChar = 9;
  450. vtPWideChar = 10;
  451. vtAnsiString = 11;
  452. vtCurrency = 12;
  453. vtVariant = 13;
  454. vtInterface = 14;
  455. vtWideString = 15;
  456. vtInt64 = 16;
  457. vtQWord = 17;
  458. vtUnicodeString = 18;
  459. type
  460. PVarRec = ^TVarRec;
  461. TVarRec = record
  462. case VType : sizeint of
  463. {$ifdef ENDIAN_BIG}
  464. vtInteger : ({$IFDEF CPU64}integerdummy1 : Longint;{$ENDIF CPU64}VInteger: Longint);
  465. vtBoolean : ({$IFDEF CPU64}booldummy : Longint;{$ENDIF CPU64}booldummy1,booldummy2,booldummy3: byte; VBoolean: Boolean);
  466. vtChar : ({$IFDEF CPU64}chardummy : Longint;{$ENDIF CPU64}chardummy1,chardummy2,chardummy3: byte; VChar: Char);
  467. vtWideChar : ({$IFDEF CPU64}widechardummy : Longint;{$ENDIF CPU64}wchardummy1,VWideChar: WideChar);
  468. {$else ENDIAN_BIG}
  469. vtInteger : (VInteger: Longint);
  470. vtBoolean : (VBoolean: Boolean);
  471. vtChar : (VChar: Char);
  472. vtWideChar : (VWideChar: WideChar);
  473. {$endif ENDIAN_BIG}
  474. {$ifndef FPUNONE}
  475. vtExtended : (VExtended: PExtended);
  476. {$endif}
  477. vtString : (VString: PShortString);
  478. vtPointer : (VPointer: Pointer);
  479. vtPChar : (VPChar: PAnsiChar);
  480. {$ifdef FPC_HAS_FEATURE_CLASSES}
  481. vtObject : (VObject: TObject);
  482. vtClass : (VClass: TClass);
  483. {$endif FPC_HAS_FEATURE_CLASSES}
  484. vtPWideChar : (VPWideChar: PWideChar);
  485. vtAnsiString : (VAnsiString: Pointer);
  486. vtCurrency : (VCurrency: PCurrency);
  487. {$ifdef FPC_HAS_FEATURE_VARIANTS}
  488. vtVariant : (VVariant: PVariant);
  489. {$endif FPC_HAS_FEATURE_VARIANTS}
  490. vtInterface : (VInterface: Pointer);
  491. vtWideString : (VWideString: Pointer);
  492. vtInt64 : (VInt64: PInt64);
  493. vtUnicodeString : (VUnicodeString: Pointer);
  494. vtQWord : (VQWord: PQWord);
  495. end;
  496. var
  497. DispCallByIDProc : codepointer;
  498. {*****************************************************************************
  499. Resourcestring support
  500. *****************************************************************************}
  501. {$ifdef FPC_HAS_FEATURE_RESOURCES}
  502. type
  503. PResourceStringRecord = ^TResourceStringRecord;
  504. TResourceStringRecord = Record
  505. Name,
  506. CurrentValue,
  507. DefaultValue : AnsiString;
  508. HashValue : LongWord;
  509. end;
  510. {$endif FPC_HAS_FEATURE_RESOURCES}