Browse Source

rtl: moved TTypeKind to unit system, fpc compatibility, needed by GetTypeKind

mattias 5 years ago
parent
commit
6fb1ce581f
2 changed files with 47 additions and 45 deletions
  1. 47 0
      packages/rtl/system.pas
  2. 0 45
      packages/rtl/typinfo.pas

+ 47 - 0
packages/rtl/system.pas

@@ -252,6 +252,53 @@ const
 
 function GUIDToString(const GUID: TGUID): string; external name 'rtl.guidrToStr';
 
+{*****************************************************************************
+                                  RTTI support
+*****************************************************************************}
+type
+  // if you change the following enumeration type in any way
+  // you also have to change the rtl.js in an appropriate way !
+  TTypeKind = (
+    tkUnknown,  // 0
+    tkInteger,  // 1
+    tkChar,     // 2 in Delphi/FPC tkWChar, tkUChar
+    tkString,   // 3 in Delphi/FPC tkSString, tkWString or tkUString
+    tkEnumeration, // 4
+    tkSet,      // 5
+    tkDouble,   // 6
+    tkBool,     // 7
+    tkProcVar,  // 8  function or procedure
+    tkMethod,   // 9  proc var of object
+    tkArray,    // 10 static array
+    tkDynArray, // 11
+    tkRecord,   // 12
+    tkClass,    // 13
+    tkClassRef, // 14
+    tkPointer,  // 15
+    tkJSValue,  // 16
+    tkRefToProcVar, // 17  variable of procedure type
+    tkInterface, // 18
+    //tkObject,
+    //tkSString,tkLString,tkAString,tkWString,
+    //tkVariant,
+    //tkWChar,
+    //tkInt64,
+    //tkQWord,
+    //tkInterfaceRaw,
+    //tkUString,tkUChar,
+    tkHelper,   // 19
+    //tkFile,
+    tkExtClass  // 20
+    );
+  TTypeKinds = set of TTypeKind;
+
+const
+  tkFloat = tkDouble; // for compatibility with Delphi/FPC
+  tkProcedure = tkProcVar; // for compatibility with Delphi
+  tkAny = [Low(TTypeKind)..High(TTypeKind)];
+  tkMethods = [tkMethod];
+  tkProperties = tkAny-tkMethods-[tkUnknown];
+
 {*****************************************************************************
                               Array of const support
 *****************************************************************************}

+ 0 - 45
packages/rtl/typinfo.pas

@@ -21,55 +21,10 @@ uses
   SysUtils, Types, RTLConsts, JS;
 
 type
-  // if you change the following enumeration type in any way
-  // you also have to change the rtl.js in an appropriate way !
-  TTypeKind = (
-    tkUnknown,  // 0
-    tkInteger,  // 1
-    tkChar,     // 2 in Delphi/FPC tkWChar, tkUChar
-    tkString,   // 3 in Delphi/FPC tkSString, tkWString or tkUString
-    tkEnumeration, // 4
-    tkSet,      // 5
-    tkDouble,   // 6
-    tkBool,     // 7
-    tkProcVar,  // 8  function or procedure
-    tkMethod,   // 9  proc var of object
-    tkArray,    // 10 static array
-    tkDynArray, // 11
-    tkRecord,   // 12
-    tkClass,    // 13
-    tkClassRef, // 14
-    tkPointer,  // 15
-    tkJSValue,  // 16
-    tkRefToProcVar, // 17  variable of procedure type
-    tkInterface, // 18
-    //tkObject,
-    //tkSString,tkLString,tkAString,tkWString,
-    //tkVariant,
-    //tkWChar,
-    //tkInt64,
-    //tkQWord,
-    //tkInterfaceRaw,
-    //tkUString,tkUChar,
-    tkHelper,   // 19
-    //tkFile,
-    tkExtClass  // 20
-    );
-  TTypeKinds = set of TTypeKind;
-
   // TCallConv for compatibility with Delphi/FPC, ignored under pas2js
   TCallConv = (ccReg, ccCdecl, ccPascal, ccStdCall, ccSafeCall, ccCppdecl,
     ccFar16, ccOldFPCCall, ccInternProc, ccSysCall, ccSoftFloat, ccMWPascal);
 
-const
-  tkFloat = tkDouble; // for compatibility with Delphi/FPC
-  tkProcedure = tkProcVar; // for compatibility with Delphi
-  tkAny = [Low(TTypeKind)..High(TTypeKind)];
-  tkMethods = [tkMethod];
-  tkProperties = tkAny-tkMethods-[tkUnknown];
-
-type
-
   { TTypeInfoModule }
 
   TTypeInfoModule = class external name 'pasmodule'