Commit Graph

2446 Commits

Author SHA1 Message Date
florian
dbee3bcc0d * fixed MSecsToTimeStamp by Lagunov Aleksey, resolves #38631
git-svn-id: trunk@49247 -
2021-04-22 20:14:00 +00:00
Károly Balogh
b149718566 sinclairql: added an entirely stub (for now) sysutils unit. added a classes unit. enabled building the whole rtl
git-svn-id: trunk@49239 -
2021-04-20 10:02:39 +00:00
michael
fe78829b99 * Fix issue ID #38772
git-svn-id: trunk@49225 -
2021-04-18 10:45:47 +00:00
florian
c1f85ac3a1 + initial implementation of path dependent IsFileNameCaseSensitive/IsFileNameCasePreserving functions for darwin
git-svn-id: trunk@49164 -
2021-04-10 13:29:59 +00:00
michael
e99c9ddd75 * Add deprecation message
git-svn-id: trunk@49038 -
2021-03-23 11:53:33 +00:00
Károly Balogh
1b1e1009c1 rtl: reverted some accidental but harmless extra changes committed in r49036
git-svn-id: trunk@49037 -
2021-03-23 09:36:45 +00:00
Károly Balogh
45b5e9215c rtl: remove defines for v2.x compiler from the common part of the RTL. It's no longer suppported to build with that
git-svn-id: trunk@49036 -
2021-03-23 09:32:49 +00:00
svenbarth
893cf511bc * fix casing of "VAr", no code changes
git-svn-id: trunk@48862 -
2021-03-02 08:06:05 +00:00
florian
2932787dee * use SizeInt for counters in math unit, all non-32 bit targets should benefit from this
git-svn-id: trunk@48815 -
2021-02-26 22:47:06 +00:00
michael
47be45830c * Fix issue ID #38462
git-svn-id: trunk@48580 -
2021-02-10 11:00:22 +00:00
florian
706e72e1fd * better error message for runtime errors 202 and 210, resolves #38254
git-svn-id: trunk@48438 -
2021-01-27 21:28:55 +00:00
svenbarth
b446023e5b * use Str instead of IntToStr to avoid overload problems with unsigned types
git-svn-id: trunk@48400 -
2021-01-24 14:57:24 +00:00
svenbarth
c3fd06b6b5 * fix for Mantis #38390: use Val instead of StrToInt to avoid overload problems
+ added test

git-svn-id: trunk@48399 -
2021-01-24 14:57:20 +00:00
svenbarth
38cde38177 * make TProxyStream.Check an abstract method; as it is right now one had to override it anyway because it always raised an exception
git-svn-id: trunk@48097 -
2021-01-06 20:25:12 +00:00
Károly Balogh
4b3fee38a5 dati.inc: tabs 2 spaces and whitespaces formatting fix. no functional changes
git-svn-id: trunk@47808 -
2020-12-18 11:55:21 +00:00
ondrej
706d89d6cc * GlobalNameSpace must EndWrite before it is released to unlock the critical section
git-svn-id: trunk@47636 -
2020-11-29 18:49:36 +00:00
ondrej
de6f3ea9b5 * rename generic TStringBuilder to TGenericStringBuilder to make code tools happy
git-svn-id: trunk@47553 -
2020-11-24 09:43:46 +00:00
Tomas Hajny
7169b6d04c * provided additional information in comments in the include file header
git-svn-id: trunk@47547 -
2020-11-24 00:45:00 +00:00
Tomas Hajny
95394d7f98 + added TZ variable based offset calculation
git-svn-id: trunk@47535 -
2020-11-23 01:08:39 +00:00
ondrej
e34e4b452a * FileSetDate linux compilation
git-svn-id: trunk@47399 -
2020-11-12 14:41:43 +00:00
ondrej
8ce015535a * FileSetDate with TDateTime and UTC for file names
git-svn-id: trunk@47398 -
2020-11-12 14:36:12 +00:00
ondrej
3ea339400e * FileGetDate, FileSetDate linux compilation
git-svn-id: trunk@47397 -
2020-11-12 13:55:01 +00:00
ondrej
d899c9fca4 * FileGetDate, FileSetDate with TDateTime and UTC
git-svn-id: trunk@47396 -
2020-11-12 13:36:39 +00:00
ondrej
33fe3f3ede TSearchRec.GetTimeStamp: fix ifdefs
git-svn-id: trunk@47395 -
2020-11-12 12:17:46 +00:00
michael
4a38d1b34e * Fix bug #38063, corner case in Remove() range checking
git-svn-id: trunk@47392 -
2020-11-12 09:27:00 +00:00
ondrej
934f2dc55d * introduce NowUTC() and GetUniversalTime()
git-svn-id: trunk@47306 -
2020-11-04 09:34:08 +00:00
ondrej
a02d676b06 GetLocalTimeOffset: add InputIsUTC parameter to DateTime-aware overloads
git-svn-id: trunk@47293 -
2020-11-03 18:15:16 +00:00
ondrej
e10ee5ccb4 GetLocalTimeOffset - fix overload call
git-svn-id: trunk@47289 -
2020-11-03 09:46:14 +00:00
ondrej
b51729dac5 File datetime UTC support
git-svn-id: trunk@47210 -
2020-10-26 20:39:21 +00:00
ondrej
0d08b98d47 GetLocalTimeOffset: DateTime-aware overloads (Windows supported, Unix is a ToDo). Issue #35710
git-svn-id: trunk@47206 -
2020-10-26 12:29:18 +00:00
ondrej
f529253c0b Deprecate TUnicodeSearchRec.Time and TRawbyteSearchRec.Time
git-svn-id: trunk@47204 -
2020-10-26 09:31:54 +00:00
ondrej
34d3429e43 More precise FileAge
git-svn-id: trunk@47203 -
2020-10-26 09:15:26 +00:00
michael
5283049a62 * Patch from Werner Pamler to implement TStringSplitOptions.ExcludeLastEmpty
git-svn-id: trunk@47068 -
2020-10-09 11:21:30 +00:00
michael
0baf7db5e4 * Fix bug where position is not advanced when calling ReadAnsiString/ReadString
git-svn-id: trunk@47061 -
2020-10-07 10:15:13 +00:00
michael
722e8d94cd * Error when seek fails
git-svn-id: trunk@47056 -
2020-10-06 08:09:50 +00:00
michael
d5cbe6809b * Add GetFileContents and GetFileAsString
git-svn-id: trunk@47055 -
2020-10-06 07:59:09 +00:00
ondrej
192bbc07f5 * simplify TThread.RemoveQueuedEvent - decide what to delete and not what to leave (better corresponds with the docs)
git-svn-id: trunk@47011 -
2020-09-30 06:56:27 +00:00
svenbarth
a624348692 * when removing a method from the synchronization queue using TThread.RemoveQueuedEvent then both the Code and the Data need to match (Delphi does the same)
+ added test

git-svn-id: trunk@47007 -
2020-09-29 17:34:26 +00:00
florian
4c1978c131 * reported by Bart on the mailing list: insert empty line to make clear to which function the comment applies
git-svn-id: trunk@46972 -
2020-09-27 13:05:36 +00:00
michael
5198686c29 * Fix bug ID #37814: correctly initialize max chars
git-svn-id: trunk@46951 -
2020-09-25 08:51:21 +00:00
Jonas Maebe
97bf6d6677 * fix formatfloat for 0 in exponential format (based on patch by
Jamie Philbrook, mantis #37374)

git-svn-id: trunk@46778 -
2020-09-05 18:44:57 +00:00
michael
a49c469a5d * Fix defines for fpdoc
git-svn-id: trunk@46763 -
2020-09-04 15:19:28 +00:00
ondrej
bbdf1b5d27 SysUtils: SInvalidDateTime <> SInvalidDateTimeFloat
git-svn-id: trunk@46747 -
2020-09-02 09:58:12 +00:00
florian
34cd1212ea * cosmetics
git-svn-id: trunk@46744 -
2020-09-01 20:32:46 +00:00
michael
df9cea5cc4 * Additional fix for GetDelimitedText
git-svn-id: trunk@46715 -
2020-08-27 07:35:51 +00:00
svenbarth
11b601d44c * TThread.Terminate does not have any platform specific behavior (it should only set FTerminated to true and call TerminatedSet), thus move it to the platform independant part
Notes:
- Netware had a ThreadSwitch in there, but that is not really required
- some platform were missing the setting of FTerminated to True, thus they'll now do that as well

git-svn-id: trunk@46543 -
2020-08-22 15:56:13 +00:00
michael
51b43aff3f * Simplified SetDelimitedText
git-svn-id: trunk@46531 -
2020-08-21 07:52:42 +00:00
michael
81c7da83a9 * Fix bug ID #0037605: Setting quotechar to NULL char disables quoting
git-svn-id: trunk@46530 -
2020-08-21 07:38:33 +00:00
yury
9a01bcf3dc * Changed Integer to Longint in definitions of RTTI structures. It fixes typinfo for 16-bit CPUs.
git-svn-id: trunk@46503 -
2020-08-20 10:31:56 +00:00
ondrej
38c7659d07 TEncoding: fix base convert functions for empty inputs
git-svn-id: trunk@46430 -
2020-08-14 14:59:05 +00:00
ondrej
67acb289d7 TWriter: fix default value handling for Int64/QWord values. Issue #37525
git-svn-id: trunk@46337 -
2020-08-09 06:13:06 +00:00
florian
87702d7cda * cosmetics
git-svn-id: trunk@46211 -
2020-08-03 19:58:47 +00:00
michael
b7bd9f3325 * Add TerminatedSet (delphi compatibility, bug ID #37388)
git-svn-id: trunk@45805 -
2020-07-18 22:35:36 +00:00
marco
9cae1830e2 * Remove typedness of feinvalidhandle constant to straight constant with typecast in rvalue. mantis #37358
Reasons for original construct unclear and probably historic, added by oro in 2006 as  feinvalidhandle : Thandle =-1 and then modified by Jonas for unsigned thandle types in 2007 to   feinvalidhandle : Thandle =thandle(-1).

git-svn-id: trunk@45790 -
2020-07-15 10:31:25 +00:00
svenbarth
0f372308b5 * fix comment: define is called HAS_OSCONFIG, not HAVE_OSCONFIG
git-svn-id: trunk@45522 -
2020-05-28 14:47:35 +00:00
michael
6b79e2c2c3 * Moved constant to rtlconsts
git-svn-id: trunk@45521 -
2020-05-28 09:45:43 +00:00
michael
74e65f77bc * Fix bug ID #37118
git-svn-id: trunk@45444 -
2020-05-20 07:32:09 +00:00
michael
ac208ab689 * clarify dubious case statements
git-svn-id: trunk@45425 -
2020-05-18 17:29:48 +00:00
svenbarth
6b548b9016 * fix for Mantis #37042: apply patch and test (adjusted for Big Endian) by Bi0T1N to add support for TBitConverter
git-svn-id: trunk@45409 -
2020-05-17 20:59:57 +00:00
svenbarth
f0e8d5dfa6 * fix for Mantis #37043: apply patch by Bi0T1N (including test) to add additional overloads for IntToHex including a rerouting of the ordinal helpers' ToHexString to use these overloads
git-svn-id: trunk@45370 -
2020-05-15 15:14:19 +00:00
michael
50261464da * Patch from N. Neumann, implement some delphi compatible StrToUint functions (bug id 37049)
git-svn-id: trunk@45336 -
2020-05-11 13:14:47 +00:00
svenbarth
c8b7094378 * fix for Mantis #36940: apply (adjusted) patch by Bi0T1N to add functionality to the thread manager to set a thread's debug name (if supported by the platform)
git-svn-id: trunk@45160 -
2020-04-28 19:58:20 +00:00
yury
8d95da3fea * Windows: Reworked handling of command line arguments to properly support Unicode:
- Use the CommandLineToArgvW API function to parse the Unicode command line (we can use it since Win9x is not supported anymore).
  - Implemented non-public functions ParamStrA and ParamStrU which are exposed in the objpas and uuchar units to provide correct AnsiString and UnicodeString versions of ParamStr(). 
  - The cleanup code is moved from InternalExit to the finalization section of the System unit.

git-svn-id: trunk@45037 -
2020-04-23 12:38:42 +00:00
florian
cd35cdad25 * fix Min/MaxSingle/Double values, resolves #36870
git-svn-id: trunk@44714 -
2020-04-13 08:48:32 +00:00
michael
2dfc5b160b * Fix wrong start/stop index
git-svn-id: trunk@44635 -
2020-04-07 14:03:42 +00:00
michael
0ff254e00f * Fix bug ID #36837: add ToObjectArray, ToStTringArray and SetStrings
git-svn-id: trunk@44632 -
2020-04-07 08:27:34 +00:00
marco
aa391dadbf * only free if not ffreeobjects, mantis 036853
git-svn-id: trunk@44457 -
2020-03-31 14:53:03 +00:00
ondrej
eb9a4eca91 SysUtils: make GetDriveIDFromLetter accept lowercase letters
git-svn-id: trunk@44389 -
2020-03-29 06:16:28 +00:00
michael
5fe164498b * Overloaded split needs similar patch
git-svn-id: trunk@44313 -
2020-03-19 21:41:58 +00:00
michael
123fe94206 * Fix bug #36806, do not add empty last sep, patch from Delfion
git-svn-id: trunk@44312 -
2020-03-19 13:47:49 +00:00
ondrej
a5ed5bd942 TFileStream: use SysErrorMessage in exception message if available
git-svn-id: trunk@44200 -
2020-02-17 08:35:15 +00:00
florian
f1eccca3a6 * catch exceptions in all variants of TextToFloat properly
* force x87 exceptions to be thrown on all platforms using x87

git-svn-id: trunk@44070 -
2020-01-30 21:23:10 +00:00
florian
69956cd97a * fix compilation on several OSes after r44010
git-svn-id: trunk@44013 -
2020-01-21 21:50:37 +00:00
florian
01302bc47d * subroutines working with an OS dependend time stamp use an int64 now, so the 2038 problem
on unixes can be tackled

git-svn-id: trunk@44010 -
2020-01-21 20:59:20 +00:00
marco
37a8536bd4 * undo 43513 which ifdefed usage of ismanagedtype for 3.2. 3.2 now supports ismanagedtype
git-svn-id: trunk@43971 -
2020-01-18 15:17:02 +00:00
marco
7fc9212ecd Two static inline constructors
git-svn-id: trunk@43950 -
2020-01-15 11:09:17 +00:00
ondrej
77fecff30e TStrings.SaveToStream(TStream): use FEncoding as the default for IgnoreEncoding=False so that loaded files are correctly resaved
git-svn-id: trunk@43948 -
2020-01-14 15:33:53 +00:00
ondrej
461a648f67 TStrings: default options:
* remove soWriteBOM for FPC backwards compatibility
* add soPreserveBOM so that a loaded file is correctly resaved

git-svn-id: trunk@43947 -
2020-01-14 15:30:38 +00:00
ondrej
c3f8b7c914 Revert r43942: TStrings: old SaveToFile(string) and SaveToStream(TStream) should ignore Encoding and stay backwards compatible within FPC. Use the other overloads for Encoding-aware SaveTo* methods
git-svn-id: trunk@43946 -
2020-01-14 15:17:30 +00:00
ondrej
6ed89d4101 TStrings: add missing SaveToFile overload with IgnoreEncoding parameter
git-svn-id: trunk@43945 -
2020-01-14 15:16:04 +00:00
ondrej
7dba9f0294 TStrings: old SaveToFile(string) and SaveToStream(TStream) should ignore Encoding and stay backwards compatible within FPC. Use the other overloads for Encoding-aware SaveTo* methods
git-svn-id: trunk@43942 -
2020-01-14 10:47:13 +00:00
ondrej
34fecf90f3 SysUtils: add ExpandFileName with a BasePath overload
git-svn-id: trunk@43928 -
2020-01-13 12:36:35 +00:00
ondrej
ee18a7ee9a classes: add TStringsOption.soPreserveBOM
git-svn-id: trunk@43848 -
2020-01-03 10:39:53 +00:00
ondrej
944e99d71c sysutils: TEncoding.IsStandardEncoding: FSystemEncodings are standard encodings (they must not be destroyed in user code)
git-svn-id: trunk@43846 -
2020-01-02 20:04:52 +00:00
ondrej
e1e4f4c122 classes: introduce TRawByteStringStream
git-svn-id: trunk@43845 -
2020-01-02 20:02:27 +00:00
ondrej
37327af58b sysutils: change TEncoding.Default from ANSI to SystemEncoding. (It is Delphi-compatible indeed because default SystemEncoding is ANSI.)
git-svn-id: trunk@43842 -
2020-01-02 19:00:32 +00:00
ondrej
5d58ced92b classes: add TStrings.Options (Delphi-compatibility)
git-svn-id: trunk@43841 -
2020-01-02 18:55:19 +00:00
ondrej
6796434268 sysutils: fix TMBCSEncoding.GetPreamble
git-svn-id: trunk@43840 -
2020-01-02 18:22:57 +00:00
ondrej
a446032f32 classes: fix TStrings.SaveToStream overloads (Delphi-compatibility + introduce IgnoreEncoding-overload for legacy FPC code like for LoadFromStream)
git-svn-id: trunk@43839 -
2020-01-02 18:10:53 +00:00
ondrej
c9ae8f94ac classes: fix TMBCSEncoding.IsSingleByte. Issue #36504
git-svn-id: trunk@43838 -
2020-01-02 16:51:05 +00:00
marco
defabdc80d * bug #36497, minor stylistic cleanup from Cyrax that replaces some pwidechar with punicodechar
git-svn-id: trunk@43826 -
2019-12-31 16:35:32 +00:00
michael
a37cb2d2fa * Fix bug #36478: add array of category names
git-svn-id: trunk@43799 -
2019-12-27 11:08:52 +00:00
ondrej
0b5bc00855 Remove misleading comment
git-svn-id: trunk@43796 -
2019-12-26 16:22:51 +00:00
michael
abeb00cd94 * Fix bug ID #34303, readability opimizations
git-svn-id: trunk@43714 -
2019-12-23 13:15:19 +00:00
michael
0b9b002807 * Fix bug ID #36425
git-svn-id: trunk@43678 -
2019-12-12 15:07:46 +00:00
michael
37a9cda682 * Treat 3.2 as 3.0.4
git-svn-id: trunk@43513 -
2019-11-18 16:00:03 +00:00
michael
a5d3aabfc2 * Fix compilation with 3.0.4
git-svn-id: trunk@43482 -
2019-11-15 16:57:13 +00:00
michael
6fcd7fe3f8 * avoid warning about visibility of ItemIsmanaged
git-svn-id: trunk@43474 -
2019-11-15 14:26:12 +00:00
michael
d21a262a6c * Fix bug #0036270: optimize TFPSList.AddList and .Assign
git-svn-id: trunk@43473 -
2019-11-15 14:12:11 +00:00
michael
23ef6459bd * Fix bug #36284: small refactoring
git-svn-id: trunk@43454 -
2019-11-12 13:04:07 +00:00
michael
5f6f5cb864 * Bit helpers for ordinal functions, adapted from batch by Thaddy De Koning (bug ID 0036146)
git-svn-id: trunk@43417 -
2019-11-08 11:43:10 +00:00
michael
f622f58b04 * Observe doclear
git-svn-id: trunk@43416 -
2019-11-08 09:31:45 +00:00
michael
e578477334 * Refactor AddDelimitedText/SetDelimitedText
git-svn-id: trunk@43415 -
2019-11-08 09:21:08 +00:00
michael
d3ceede910 * Reduce use of Length(aValue) in setdelimitedtext
git-svn-id: trunk@43414 -
2019-11-08 08:36:31 +00:00
michael
3b867da924 * Add AddDelimitedText,AddCommatext by Werner Pamler (bug ID 36249)
git-svn-id: trunk@43405 -
2019-11-06 10:51:34 +00:00
michael
2557c8e99b * Fix bug ID #0036268, more descriptive comment
git-svn-id: trunk@43404 -
2019-11-06 10:42:11 +00:00
florian
b8f186dab2 * reverted r43366
git-svn-id: trunk@43382 -
2019-11-03 14:42:02 +00:00
florian
5ead23513d * more overloads for Math.Min/Max, resolves #36161
git-svn-id: trunk@43366 -
2019-11-02 16:21:43 +00:00
michael
faee789507 * Add some functional methods to TStrings
git-svn-id: trunk@43365 -
2019-11-02 15:08:27 +00:00
michael
20ca7d857c * Fix bug ID #36234: unicodedatastering must be of type unicodestring
git-svn-id: trunk@43357 -
2019-11-02 11:51:28 +00:00
michael
30bc217d55 * Fix bug ID #0036246, delphi compatibility property
git-svn-id: trunk@43353 -
2019-11-02 10:25:42 +00:00
michael
c6d8bd73f7 * Patch from Serge Anvarov with some optimizations (bug ID 36143)
git-svn-id: trunk@43155 -
2019-10-09 07:13:37 +00:00
michael
e89383a104 * Fix bug ID #36136, wrong reference count caused by missing const in param
git-svn-id: trunk@43138 -
2019-10-06 08:04:10 +00:00
svenbarth
f46b8539d0 * implement FileSymLinkGetTarget for *nix systems
git-svn-id: trunk@43113 -
2019-10-03 12:07:33 +00:00
svenbarth
b289805a91 * correctly copy Size and Attr values when converting from one T*SymLinkRec to the other
git-svn-id: trunk@43108 -
2019-10-03 12:07:13 +00:00
svenbarth
178146f06c - TRawByteSymLinkRec.Name is not required (and TUnicodeSymLinkRec doesn't have it either)
git-svn-id: trunk@43107 -
2019-10-03 12:07:09 +00:00
svenbarth
a00be912aa * fix regression introduced with r42240: packed sets for the Integer based variants of SetToString/StringToSet need to be shifted on Big Endian systems
git-svn-id: trunk@43048 -
2019-09-21 14:36:19 +00:00
marco
8dddf8a525 * patch from Ondrej, TVerticalAlignment & TTopBottom
git-svn-id: trunk@42813 -
2019-08-25 09:37:21 +00:00
svenbarth
7e1607e095 * correct alignment for the property table
git-svn-id: trunk@42808 -
2019-08-24 23:08:36 +00:00
svenbarth
2dc771b7ba * TClassData also needs alignment dummies
git-svn-id: trunk@42807 -
2019-08-24 23:08:33 +00:00
svenbarth
2002650a23 * small corrections (grammar, casing, typo) for the comment for TCallConv
git-svn-id: trunk@42802 -
2019-08-24 23:08:17 +00:00
michael
91ba1214d2 * Allow context when sorting lists (patch from Ondrej Pokorny, bug ID #0035962)
git-svn-id: trunk@42798 -
2019-08-24 10:46:51 +00:00
svenbarth
8e8ffa0511 * fix a rather annoying typo
git-svn-id: trunk@42772 -
2019-08-23 14:59:10 +00:00
svenbarth
707e05d131 * check for CPUM68k instead of M68K; the latter should only be defined when building the compiler, so I wonder how that ever worked...
git-svn-id: trunk@42765 -
2019-08-22 20:45:48 +00:00
svenbarth
3d585db43d * fix for Mantis #35906: use more accurate modified time from the FindData on Windows for the Timestamp
git-svn-id: trunk@42559 -
2019-08-02 13:16:17 +00:00
florian
1a67ffdd22 * fix alignment of ParamList
* fix test for architectures using aligned rtti

git-svn-id: trunk@42516 -
2019-07-28 12:43:15 +00:00
florian
23585ded15 * fix access to ParamFlags of the tkMethod branch of type data for CPUs requiring proper alignment
git-svn-id: trunk@42511 -
2019-07-28 11:55:19 +00:00
florian
73acb4d1c1 * fixes TInterfaceRawData to match TTypeData
git-svn-id: trunk@42486 -
2019-07-23 19:59:34 +00:00
nickysn
a3a39e1640 * i8086 compilation fix after changeset 42390
git-svn-id: trunk@42485 -
2019-07-23 11:57:20 +00:00
florian
217ae6e4bb * more fixes to rtti after attribute branch merging
git-svn-id: trunk@42476 -
2019-07-21 08:28:29 +00:00
svenbarth
176a63b67b * fix for Mantis #35862: free the list of functions added with AddTerminateProc to avoid memory leaks
+ added test

git-svn-id: trunk@42457 -
2019-07-19 15:55:21 +00:00
marco
6ca93e294f * SecsPerHour, delphi compatibility.
git-svn-id: trunk@42452 -
2019-07-17 21:15:17 +00:00
svenbarth
71fa4d1fe2 * the RTTI of an attribute not only consists of the creation function, but also of the attribute's type, a pointer to the constructor and a data blob containing the constant parameters
+ added test

git-svn-id: trunk@42390 -
2019-07-12 22:07:05 +00:00
svenbarth
8cd1f1973b - remove unneeded local variable
git-svn-id: trunk@42386 -
2019-07-12 22:06:48 +00:00
svenbarth
affa9f9d9c * to be on the safe side: don't include AttributeTable fields when cycling
git-svn-id: trunk@42385 -
2019-07-12 22:06:44 +00:00
svenbarth
3ad24c9db8 * as attributes can be part of any type they are best suited in a common part of TTypeData
git-svn-id: trunk@42375 -
2019-07-12 22:06:09 +00:00
svenbarth
de15025a47 * streamline retrieval of attributes (both in TypInfo and RTTI units)
git-svn-id: trunk@42373 -
2019-07-12 22:06:02 +00:00
svenbarth
e060a43d70 * rename TAttributeData to the more appropriate TAttributeTable
git-svn-id: trunk@42371 -
2019-07-12 22:05:55 +00:00
svenbarth
c17dafc2f9 * fix TClassData by including the AttributeTable at the right location
git-svn-id: trunk@42370 -
2019-07-12 22:05:51 +00:00
svenbarth
e296b26e9e - remove unit info and related code again as that will be handled similar, but differently with dynamic packages
git-svn-id: trunk@42369 -
2019-07-12 22:05:47 +00:00
svenbarth
ee940c8270 * always write a class' reference to the attribute table, even if the unit does not have attributes
git-svn-id: trunk@42368 -
2019-07-12 22:05:42 +00:00
svenbarth
788d976f3a * use a Word instead of a Byte for the attribute index (after all the compiler writes a Word to the count field)
git-svn-id: trunk@42367 -
2019-07-12 22:05:39 +00:00
svenbarth
5153a288dc * it's more correct for GetPropAttribute to return a TCustomAttribute instead of a TObject
git-svn-id: trunk@42366 -
2019-07-12 22:05:33 +00:00
svenbarth
d137e06ade * instead of embedding the attributes inside the class' and property's type data only store a reference to a table of attributes
git-svn-id: trunk@42365 -
2019-07-12 22:05:29 +00:00
svenbarth
84848df18d Reintegration of Custom Attributes branch by Joost van der Sluis with patches reworked by Svetozar Belic [patch 3/3]
Added FPC_REQUIRES_PROPER_ALIGNMENT to TUnitInfo definition. Added FPC_HAS_EXTENDED_RTTI define.

git-svn-id: trunk@42358 -
2019-07-12 22:04:56 +00:00
svenbarth
b2932393df Reintegration of Custom Attributes branch by Joost van der Sluis with patches reworked by Svetozar Belic [patch 1/3]
Implemented attributes for class types and properties (based on work by Joost van der Sluis). Added TCustomAttribute - a base class for attributes. Added TUnitInfo record to RTTI. It contains the unit name and unit options (for now only a flag which specifies if the unit contains attributes). Added several tests for attributes.

git-svn-id: trunk@42356 -
2019-07-12 22:04:48 +00:00
michael
a516b6fd74 * Fix bug ID #0035817
git-svn-id: trunk@42351 -
2019-07-11 20:33:39 +00:00
michael
561fa85104 * Fix comment for DateTimeToStr
git-svn-id: trunk@42315 -
2019-06-30 17:20:35 +00:00
michael
024714fa20 * Fix non-threading platforms
git-svn-id: trunk@42249 -
2019-06-19 08:10:26 +00:00
michael
ade808cb43 * Patch from Pascal Riekenberg to make component loading thread safe (bug ID 35638)
git-svn-id: trunk@42248 -
2019-06-19 06:25:02 +00:00
svenbarth
cc5549f3e7 * change Value argument of SetToString and result of of StringToSet from Integer to LongInt so that small sets are handled on 8/16-bit platforms as they are on 32- and 64-bit
git-svn-id: trunk@42245 -
2019-06-17 20:48:58 +00:00
svenbarth
15d0deff81 * fix SetToString/StringToSet for 8/16-bit platforms
git-svn-id: trunk@42244 -
2019-06-17 20:48:49 +00:00
svenbarth
89e454aca8 * rework/extend SetToString/StringToSet so that sets with a size > 4 can be converted as well (this is Delphi compatible)
+ added test

git-svn-id: trunk@42240 -
2019-06-16 21:36:25 +00:00
michael
b2e47cceb2 * Added constant for new error message in stringlist
git-svn-id: trunk@42172 -
2019-06-04 07:29:53 +00:00
michael
4d1e2c6aa5 * Sort public properties/methods in stringlist
git-svn-id: trunk@42171 -
2019-06-04 07:08:45 +00:00
michael
7c36912eb0 * Better fix for 35660: Introduced TMissingNameValueSeparatorAction
git-svn-id: trunk@42170 -
2019-06-04 07:00:48 +00:00
michael
de30f7852d * Changed String.Split to conform to behaviour in Delphi Rio (bug ID 35669)
git-svn-id: trunk@42168 -
2019-06-03 06:27:37 +00:00
michael
833e00bfbd * Fix bug #35660, introduce prefervaluestonames
git-svn-id: trunk@42153 -
2019-06-01 09:42:27 +00:00
michael
167ca93d25 * Patch from Ondrej to remove unnecessary overload keywords
git-svn-id: trunk@42062 -
2019-05-14 08:36:52 +00:00
michael
6649fab22d * Fix bug ID #0035580
git-svn-id: trunk@42058 -
2019-05-13 20:23:50 +00:00
michael
e4385d1b19 * Fix bug ID #35576
git-svn-id: trunk@42057 -
2019-05-13 20:15:00 +00:00
michael
dc592a888f * Make explicit that Integer is 32-bit
git-svn-id: trunk@42056 -
2019-05-13 11:47:46 +00:00
michael
fdccb0d62f * FIx compilation with 3.0.4
git-svn-id: trunk@42049 -
2019-05-12 15:36:04 +00:00
michael
58f1a8513b * FIx compilation for platforms that do not have extended
git-svn-id: trunk@42048 -
2019-05-12 15:33:26 +00:00
michael
60efc9e81c * Add Read/Write(Buffer) TBytes, ReadData/WriteData, ReadBufferData/WriteBufferData to be Delphi compatible
git-svn-id: trunk@42042 -
2019-05-12 10:09:16 +00:00
pierre
819752c334 Avoid warnings when -v0 is used by using $push/$pop
git-svn-id: trunk@41960 -
2019-04-29 14:19:16 +00:00
michael
a254a49e84 * Patch from Ondrej Pokorny to fix bug ID : #32961 reflect system code page change in TEncoding
git-svn-id: trunk@41951 -
2019-04-28 09:02:41 +00:00
svenbarth
b7a716cd81 * correct return a pointer to the list so that List^[x] works as it did before 3.2
+ added test

git-svn-id: trunk@41938 -
2019-04-26 08:13:11 +00:00
svenbarth
9d10f21b07 * applied patch by Thaddy de Koning to fix Mantis #35378: correctly declare TNativeIntHelper.MinValue
git-svn-id: trunk@41881 -
2019-04-16 09:24:05 +00:00
michael
27894ebe68 * Patch from Serge Anvarov to improve TStrings.GetNextLine and TStrings.GetNextLineBreak (bug ID 35331)
git-svn-id: trunk@41853 -
2019-04-09 11:35:56 +00:00
michael
08d6b446f0 * Fix bug ID #35345, allow tstrings.text to exceed 2Gb
git-svn-id: trunk@41852 -
2019-04-09 11:16:56 +00:00
michael
cae2c94e90 * Patch from Ondrej Pokorny to let AddStrings call beginupdate/endupdate under all circumstances (bug ID 35341)
git-svn-id: trunk@41849 -
2019-04-08 07:51:19 +00:00
michael
e3973e9c4e * Fix bug #35305, lazy instantiation of class alias list. Patch from Ondrej Pokorny
git-svn-id: trunk@41819 -
2019-04-01 17:31:20 +00:00
michael
60606e61ef * Patch from Ondrej Pokorny to make RegisterClassAlias thread-safe
git-svn-id: trunk@41818 -
2019-04-01 17:25:29 +00:00
michael
1951aff5a4 * Fix formatfloat in case E not followed by +/- (bug id 35297)
git-svn-id: trunk@41803 -
2019-03-30 15:47:50 +00:00
michael
2669b68e6d * Added move on TCollection (bug ID 32673)
git-svn-id: trunk@41795 -
2019-03-26 07:03:24 +00:00
michael
905ccf9363 * Make FreeEncodings protected: they cannot be public, as it causes AVs (see bug ID #34856)
git-svn-id: trunk@41547 -
2019-03-02 10:42:19 +00:00
michael
541bf05b94 * Add overloaded version of AssignFile with codepage. See bug ID #34889
git-svn-id: trunk@41342 -
2019-02-16 12:52:00 +00:00
michael
3fcc1c5f0e * Complete the implementation of IsLeadChar
git-svn-id: trunk@41336 -
2019-02-16 10:50:31 +00:00
michael
4143ecf6c0 Fix bug ID #35086: TParser should reset position (tentative)
git-svn-id: trunk@41331 -
2019-02-16 08:39:40 +00:00
michael
a750039f7c * Add overloaded version of stringreplace with replacement count (ID 23987)
git-svn-id: trunk@41330 -
2019-02-16 07:55:26 +00:00
svenbarth
b810d8f32b * fix for Mantis #35027: ensure that the synchronize event entry is reset correctly in case of an exception
+ added test

git-svn-id: trunk@41281 -
2019-02-10 15:43:03 +00:00
svenbarth
1502a13e7c * fix for Mantis #35028: when the mainthread executes a queued ThreadMethod make sure that the queue entry is released even if an exception is raised
+ added test

git-svn-id: trunk@41280 -
2019-02-10 15:42:58 +00:00
marco
93fcce4ba1 * tohexstring calls inttohex instead of hexstr. Hexstr has fixed number of
digits, inttohex a minimum number. Mantis #35015

git-svn-id: trunk@41268 -
2019-02-09 17:12:20 +00:00
nickysn
ff90e7622a + added .Sort overloads, that specify an algorithm and use the sortbase defined
algorithms for sorting TList, TFPList and TStringList when FPC_TESTGENERICS is
  defined as well. Unfortunately, I couldn't test it, because the RTL doesn't
  compile with FPC_TESTGENERICS, due to errors, completely unrelated to the
  sortbase changes.

git-svn-id: trunk@41248 -
2019-02-07 15:45:13 +00:00
nickysn
1d7ff66602 + added .Sort() overloads with a SortingAlgorithm parameter to TFPGList,
TFPGObjectList, TFPGInterfacedObjectList and TFPSMap

git-svn-id: trunk@41196 -
2019-02-03 19:49:35 +00:00
nickysn
d86da19570 * use the sort algorithm from sortbase for TStringList
git-svn-id: trunk@41194 -
2019-02-03 17:00:21 +00:00
marco
91fd2396fc * patch from mantis 34851 committed. use size in bits to set result of openbit instead of a fsize*32.
git-svn-id: trunk@41185 -
2019-02-03 14:06:40 +00:00
nickysn
ad677070f4 * hook TFPSList.QuickSort to also call the default sorting algorithm from sortbase
git-svn-id: trunk@41179 -
2019-02-02 23:08:25 +00:00
nickysn
63f9afa6bd * fixed TFPList.Sort. Scary news: turns out we don't have any tests for
TFPList.Sort or TList.Sort... :(

git-svn-id: trunk@41177 -
2019-02-02 22:52:08 +00:00
nickysn
4ea42ab6d2 * use the sortbase sorting algorithm in fgl as well
git-svn-id: trunk@41176 -
2019-02-02 22:49:39 +00:00
nickysn
25f6da7066 * added PtrList to the names of the current sort algorithm callback functions and
types, to indicate they sort a list of pointers

git-svn-id: trunk@41170 -
2019-02-02 20:56:59 +00:00
nickysn
e8dc54c768 + added TList.Sort overload with a sorting algorithm parameter
git-svn-id: trunk@41169 -
2019-02-02 20:31:16 +00:00
nickysn
248fd313f8 + introduced unit SortBase, which implements the foundation for pluggable
sorting algorithms. A default QuickSort implementation is provided by the
  unit. Other units can be added, to provide other sorting algorithms (e.g.
  HeapSort, MergeSort, IntroSort, etc.)
* TList and TFPList updated to use the current default sorting algorithm defined
  in SortBase for their .Sort method.

git-svn-id: trunk@41167 -
2019-02-02 20:06:50 +00:00
Jonas Maebe
b1a2b405ea * TMultiReadExclusiveWriteSynchronizer: removed some unnecessary barriers and
added some potentially missing ones

git-svn-id: trunk@41166 -
2019-02-02 15:19:32 +00:00
marco
0da16e7dbe * unicode version of isleadchar. utf8 still to follow, see #34754
git-svn-id: trunk@41085 -
2019-01-27 14:52:52 +00:00
svenbarth
81fa0924d8 * an exception does not need to inherit from Exception, so declare that as such for the thread queue entry for the sake of clarity
git-svn-id: trunk@40652 -
2018-12-25 23:30:38 +00:00
svenbarth
3e0da1ef1c * fix for Mantis #34640: don't access the thread queue entry directly after it was added to the queue if it's a Queue()d entry instead of a Synchronize()d one
git-svn-id: trunk@40651 -
2018-12-25 23:30:35 +00:00
michael
93ec37a4bc Added overloads UintToStr for Delphi compatbibility (bug ID 0034690)
git-svn-id: trunk@40529 -
2018-12-12 08:29:24 +00:00
nickysn
da5868b668 + added method TBits.CopyBits for fast copying
git-svn-id: trunk@40524 -
2018-12-11 15:52:09 +00:00
michael
863ede7dc6 * Add QWord version of Max (Delphi compatibility, bug ID #34364)
git-svn-id: trunk@39995 -
2018-10-20 12:28:56 +00:00
michael
ab159c638c * Move consts to stdconv
git-svn-id: trunk@39994 -
2018-10-20 12:18:16 +00:00
michael
407753ea10 * Add constants for powers of 10 and 2. use integer/int64 where possible
git-svn-id: trunk@39992 -
2018-10-20 10:40:12 +00:00
florian
edd72ca6d2 * few inline directives added to types, resolves #34424
git-svn-id: trunk@39984 -
2018-10-18 19:35:56 +00:00
michael
a7278c1806 * Fix split, last term of length 1 is sometimes missed
git-svn-id: trunk@39843 -
2018-09-30 09:18:21 +00:00
marco
7833dbf6a4 * uppercase relative_P_ath. Mantis #34262
git-svn-id: trunk@39743 -
2018-09-12 11:24:19 +00:00
svenbarth
a076677336 * instead of a flags field generate a table with all Initialize operators of all fields (nested or not, parent class or not) for class types; objects and records don't use this (yet)
git-svn-id: trunk@39690 -
2018-08-29 19:21:35 +00:00
svenbarth
2e1327b6b2 * use pooled constant references for the parameter locations as more often than not they're equal between multiple methdos (e.g. the Self argument is always the same)
* using this the TypInfo unit can navigate interface methods and VMT method parameters much more quickly as the latter have a constant size now

git-svn-id: trunk@39686 -
2018-08-29 19:20:31 +00:00
svenbarth
029ec93df6 * use pooled constant references for the names of VMT methods in the RTTI
git-svn-id: trunk@39685 -
2018-08-29 19:20:27 +00:00
svenbarth
228d3252cc * use pooled constant references for the parameter names of VMT methods in the RTTI
git-svn-id: trunk@39684 -
2018-08-29 19:20:24 +00:00
svenbarth
e110d90127 + implement FileGetSymLinkTarget() based on patch by Serge Anvarov in Mantis #32370
git-svn-id: trunk@39671 -
2018-08-24 15:34:04 +00:00
svenbarth
09e5f463dc + add Delphi-compatible FileGetSymLinkTarget functions to all platforms (currently returns False on all platforms); this also includes TSymLinkRec variants for both RawByteString and UnicodeString
git-svn-id: trunk@39669 -
2018-08-24 15:33:45 +00:00
svenbarth
92dcdd8b5b + add Delphi compatible FollowLink parameter (default is True) to FileExists and DirectoryExists; support for it is up to each target
git-svn-id: trunk@39668 -
2018-08-24 15:33:09 +00:00
marco
15fcd0ab61 * remove old ifdefs
git-svn-id: trunk@39642 -
2018-08-19 14:54:58 +00:00
florian
a825a66d01 * IntPower inverts the base first for negative exponents and multiplies then, resolves #34124
git-svn-id: trunk@39621 -
2018-08-16 20:45:35 +00:00
michael
ab84f09591 * Fix bug #39521. Generic functions only in trunk
git-svn-id: trunk@39525 -
2018-07-29 21:43:03 +00:00
michael
1e3f44965f * Added generic IfThen, as proposed by Thaddy de Koning, bug id #34012
git-svn-id: trunk@39521 -
2018-07-29 09:35:54 +00:00
svenbarth
38c30a557d * deprecate MaxGListSize; it's no longer used by the generic types
git-svn-id: trunk@39465 -
2018-07-17 19:30:29 +00:00
svenbarth
2ec7a5acff * change declaration of TTypeList from a static array to a pointer to T as the static array might breach the
limits for static arrays if the used type is too large (especially on 32-bit systems); as FPC supports indexing
of typed pointers like arrays this should be mostly backwards compatible

git-svn-id: trunk@39464 -
2018-07-17 19:30:26 +00:00
michael
53e10c99d4 * Fix bug #33984, fix for correct string definition in unicodestringreplace
git-svn-id: trunk@39452 -
2018-07-14 16:27:52 +00:00
michael
844a9b0ca6 * Actually observe TStringStream.OwnsEncoding in destructor
git-svn-id: trunk@39379 -
2018-07-04 11:03:21 +00:00
svenbarth
ddb501bddf * use a TObject constraint for TFPGObjectList and TFPGObjectMap to ensure that only TObject and its descendants
are used (allows for a better error message)

git-svn-id: trunk@39363 -
2018-07-03 18:34:41 +00:00
michael
a9205c9fba * Fix bug ID #32837, correct Mantissa and Fraction in float helpers, patch from Bart Broersma
git-svn-id: trunk@39346 -
2018-06-29 20:51:32 +00:00
michael
58b480e0b2 * Fix bug ID #33860
git-svn-id: trunk@39330 -
2018-06-28 12:41:49 +00:00
svenbarth
8536abce8a * as the management operator feature is not platform specific using a specific define for it aside from a
version check is unnecessary, thus remove the FPC_HAS_MANAGEMENT_OPERATOR define and instead check for VER3_0

git-svn-id: trunk@39257 -
2018-06-20 19:00:24 +00:00
svenbarth
ac0322c323 + add a flags field to the record init RTTI which declares whether
a) the current record contains a field with non-trivial initialization
    b) and of the parents contains such a field (only relevant for objects and classes)

git-svn-id: trunk@39255 -
2018-06-20 19:00:17 +00:00
florian
400861a907 * fixed TBits.NotBits, it is just an Xor operation, resolves #33706
git-svn-id: trunk@39243 -
2018-06-19 20:38:15 +00:00
svenbarth
8a195c44ba + add overloads of IsInfinite() for Single and Extended (compatible with Delphi)
git-svn-id: trunk@39135 -
2018-05-28 15:36:18 +00:00
pierre
dfcb34aef2 * Ansi2UnicodeMove:
- Avoid calling Utf8ToUnicode with only three parameters,
  as this is not reliable if the ansitring contains embedded #0 chars.
  Use explicit high(SizeUInt) or allocated length explicitly.
  - Change destLen type to SizeUInt.
  * UpperAnsiString, LowerAnsiString:
  Also avoid call to Utf8ToUnicode with only three parameters.
  Change type of slen and ulen local variables to SizeUInt.
  * CompareStrAnsiString:
  Fix sign of return value if l2=0 (was returning negative value)

git-svn-id: trunk@38972 -
2018-05-11 12:12:37 +00:00
pierre
26cc97745a Fix wrong starting index in CompareStrAnsiString function
git-svn-id: trunk@38963 -
2018-05-09 23:14:45 +00:00
michael
7aa7f1b96f * Fix bug #33681
git-svn-id: trunk@38896 -
2018-05-03 07:09:05 +00:00
michael
e4ef17b5c0 * Use SizeInt, let StartsWith/EndsWith handle #0 characters (bug ID 33559)
git-svn-id: trunk@38769 -
2018-04-14 12:06:48 +00:00
florian
add418db0e * properly define Min/Max values of Native*Int helpers, resolves #33543
git-svn-id: trunk@38664 -
2018-04-02 21:31:23 +00:00
michael
8b19eddd13 * Remove scrollh again, Lazarus solved it another way
git-svn-id: trunk@38658 -
2018-04-01 08:19:17 +00:00
michael
616d8073f2 * Implement flushbuffer abstract method in TFiler (part 2) (bug ID 33062)
git-svn-id: trunk@38656 -
2018-04-01 07:19:34 +00:00
michael
a137486439 * Implement flushbuffer abstract method in TFiler (bug ID 33062)
git-svn-id: trunk@38655 -
2018-04-01 07:16:34 +00:00
michael
6d49a7b93f * Put Collection.Assign loop in beginupdate/endupdate (bug ID 33517)
git-svn-id: trunk@38628 -
2018-03-26 19:02:51 +00:00
michael
31a354a3bc * Fix bug #33516
git-svn-id: trunk@38627 -
2018-03-26 16:31:28 +00:00
pierre
921b406c05 Fix for webtbs/tw11006.pp and test/tbs/tb0632.pp instability.
* Add ThreadQueueLockCounter variable to
  postpone call to DoneCriticlSection to the last thread
  that decrements back the counter to zero.
  * CommonCleanup:
  Protect ThreadQueue emptying within
  a Enter/Leave-CriticalSection to avoid access y other
  threads at the same time.

git-svn-id: trunk@38626 -
2018-03-25 20:32:25 +00:00
michael
e46b89c8bb * Patch from Ondrej Pokorny to fix camelcase (bug ID 4b46872)
git-svn-id: trunk@38619 -
2018-03-24 14:39:56 +00:00
michael
16ba47be46 * Patch from Ondrej Pokorny to convert unit names to CamelCase (bug ID 33481)
git-svn-id: trunk@38616 -
2018-03-23 22:06:36 +00:00
michael
bf3e437dd6 * Fix bug #33475, add AddPair for Delphi compatibility, modified patch by Silvio Clecio
git-svn-id: trunk@38587 -
2018-03-21 10:30:02 +00:00
pierre
31620a9c94 Add ESigQuit Exception class and use it in exceptmap
git-svn-id: trunk@38586 -
2018-03-21 10:28:33 +00:00
pierre
250e924ad3 + Add RTE 236 for thread errors:
inc/systemh.inc and java/jsystemh.inc:
    + Add reThreadError (and also reNoDynLibsSupport) to TRuntimeError.
    * Add new values to RuntimeErrorExitCodes after extension of TRuntimeError
  inc/system.inc and java/jsystem.inc:
    * use RTE 236 in fpc_threaderror.
  objpas/sysconst.pp and objpas/sysutils/stre.inc:
    + Add SThreadError string constant.
  objpas/sysutils/sysutilh.inc:
    + Add EThreadError class.
  objpas/sysutils/sysutils.inc
    + Add 236 to EThreadError conversion to exeptmap.

git-svn-id: trunk@38584 -
2018-03-21 10:19:04 +00:00
michael
a877616dd5 * Fix bug #33441 (patch from Silvio Clécio)
git-svn-id: trunk@38539 -
2018-03-17 00:01:51 +00:00
florian
8a2cf56d51 * fixed operator mod for floats as proposed by wp in #33167, resolves #33167
git-svn-id: trunk@38332 -
2018-02-24 18:23:06 +00:00
michael
77caa28bab * Fix bug #33204
git-svn-id: trunk@38327 -
2018-02-24 11:12:11 +00:00
svenbarth
640480272f * adjust TThread.Synchronize so that it also works correctly if the passed in thread instance is not the instance of the current thread
+ added test

git-svn-id: trunk@38124 -
2018-02-05 21:50:00 +00:00
svenbarth
2d52536460 * only check for the method if one is given at all (otherwise everything would be skipped)
git-svn-id: trunk@38115 -
2018-02-04 20:20:32 +00:00
michael
56fae4697a * Accidentally removed keyword virtual from loadfromfile
git-svn-id: trunk@37966 -
2018-01-14 11:52:13 +00:00
michael
cbc50c5fe6 * Restore signature of loadfromstream/loadfromfile, make default delphi compatible
git-svn-id: trunk@37965 -
2018-01-14 10:11:56 +00:00
michael
5c1df42fa4 * Fix bug #32871
git-svn-id: trunk@37962 -
2018-01-13 18:21:44 +00:00
michael
f6a08a2c74 * Patch from Ondrej Pokorny to allow correct nodefault/stored for strings
git-svn-id: trunk@37954 -
2018-01-13 10:22:16 +00:00
marco
af85960d62 * East Asian locales era patch from Mantis #33003
git-svn-id: trunk@37944 -
2018-01-11 10:29:32 +00:00
marco
acf6fde3cf * fix widestringreplace, shared routine missed some *sizeof(srchar) here and there.
patch from Cyrax, Mantis #32649

git-svn-id: trunk@37882 -
2017-12-30 15:51:53 +00:00
marco
b20dd5cdbb * fpslist.deleterange mantis #32807
git-svn-id: trunk@37871 -
2017-12-29 18:05:13 +00:00
michael
e160d4c530 * Fix bug ID #32889, handle ReadInterfaceRaw in TReader
git-svn-id: trunk@37856 -
2017-12-29 10:54:14 +00:00
michael
5e40444272 * Free component on error (bug ID 32626)
git-svn-id: trunk@37851 -
2017-12-29 09:37:57 +00:00
michael
fb7d2d9ebd * Patch from Anton Shepelev to fix variance and standard deviation calculation (bug ID 32804)
git-svn-id: trunk@37791 -
2017-12-24 10:02:02 +00:00
pierre
29b52824cf Try to fix TRect problem for wince
git-svn-id: trunk@37783 -
2017-12-22 11:50:59 +00:00
pierre
ec45d8617c Fix wince rtl compilation (fix for bug report 32859)
git-svn-id: trunk@37778 -
2017-12-21 17:45:20 +00:00
nickysn
532ff65e87 + enabled compilation of unit types for win16
git-svn-id: trunk@37736 -
2017-12-15 17:55:29 +00:00
nickysn
5409450195 + ported and enabled compilation of unit sysutils for win16
git-svn-id: trunk@37734 -
2017-12-15 16:58:49 +00:00
florian
b41cb26727 + write selected features in ppu of the system unit and load them further on
* ppu version update
* -Sf might be used only during system unit compilation
* loadsystemunit factored out so the system unit can be loaded earlier than other units to get features set

git-svn-id: trunk@37708 -
2017-12-10 16:32:56 +00:00
marco
a5487d327f * intmean, patch by Bart. Bug #32661
git-svn-id: trunk@37688 -
2017-12-06 10:30:02 +00:00
florian
7741b495bd - duplicate defintion of TBoundArray removed, resolves #32530
git-svn-id: trunk@37627 -
2017-11-26 21:03:52 +00:00
marco
fb57fd7324 * patch from Mattias fixing save/restore ancestorpos in twriter. Mantis #32607
git-svn-id: trunk@37513 -
2017-10-24 13:23:26 +00:00
michael
3f09294aab * Functions to see whether a published property is readable or writeable
git-svn-id: trunk@37497 -
2017-10-20 19:41:56 +00:00
michael
a3bcefd78c * Use pointer get/set methods
git-svn-id: trunk@37496 -
2017-10-20 19:17:11 +00:00
michael
3d3bbcfa9c * Raise error if property cannot be written (Enhanced patch from Ondrej Pokorny, bug ID #32586)
git-svn-id: trunk@37495 -
2017-10-20 18:44:35 +00:00
svenbarth
7e3ad42f33 + add types for the VMT's message table (the names are Delphi compatible, even if TVmtMethodEntry has no Len field)
git-svn-id: trunk@37489 -
2017-10-18 19:38:03 +00:00
svenbarth
e6b39ebf15 + add methods for easier enumeration of the fields in a class' field table
git-svn-id: trunk@37484 -
2017-10-17 21:07:32 +00:00
svenbarth
0ba1073615 + add new type TVmtFieldClassTab for the class table of the field table (Delphi compatible)
git-svn-id: trunk@37483 -
2017-10-17 20:54:38 +00:00
svenbarth
530213711f * change the class references in a class' field table to indirect references
git-svn-id: trunk@37482 -
2017-10-17 20:34:21 +00:00
svenbarth
1ae344394a + add data record for easier access to a class' data
git-svn-id: trunk@37420 -
2017-10-07 21:40:42 +00:00
svenbarth
81a0f88d8c + add Delphi compatible TThread.ForceQueue() which enqueues the method also for the main thread (at least if the RTL is in multi threading mode, otherwise it's still executed right away - whether this is Delphi compatible needs to be tested as I only have a 10.1 currently which does not yet support TThread.ForceQueue())
+ added test

git-svn-id: trunk@37359 -
2017-09-29 21:19:45 +00:00
michael
3d17111e2f * Remove double inline; chokes fpdoc (2nd occurrence)
git-svn-id: trunk@37349 -
2017-09-28 12:32:17 +00:00
michael
809a096232 * Remove double inline; chokes fpdoc
git-svn-id: trunk@37348 -
2017-09-28 12:13:38 +00:00
michael
52fe038b53 * use system.HMOdule when available
git-svn-id: trunk@37302 -
2017-09-22 15:29:09 +00:00
michael
aabc5dc217 * Add AddList to list classes (bug ID 32447)
git-svn-id: trunk@37268 -
2017-09-20 14:21:52 +00:00
pierre
07ba4f8cca Add FSem and FSuspendedExternal private fields for BeOS
git-svn-id: trunk@37260 -
2017-09-20 08:50:08 +00:00
marco
b6824290fc * initial fileflush, mantis #15824
git-svn-id: trunk@37135 -
2017-09-03 16:41:32 +00:00
svenbarth
5c97248f85 + also write the set's size to the RTTI as that simplifies handling in Invoke()
git-svn-id: trunk@37090 -
2017-08-31 19:23:12 +00:00
pierre
e325284160 Fix compilation failure for systems that do not have dynlibs
git-svn-id: trunk@37056 -
2017-08-25 07:28:35 +00:00
michael
a4c4ce1764 * Capture result in SafeLoadLibrary
git-svn-id: trunk@37050 -
2017-08-24 09:27:49 +00:00
michael
b6700f68b8 * Fix bug #32314 (SafeLoadLibrary does nothing on other platforms than windows)
git-svn-id: trunk@37049 -
2017-08-24 08:46:07 +00:00
svenbarth
8b5461367b * move TTypeKind from TypInfo unit to System unit as it's necessary for the future GetTypeKind() intrinsic
* also adjust (P)Byte usages to (P/T)TypeKind where necessary/approbiate

git-svn-id: trunk@36873 -
2017-08-11 20:37:36 +00:00
michael
3a046bda5f * Fix bug ID #31647: added new shift state: ssScrollH
git-svn-id: trunk@36768 -
2017-07-23 09:10:11 +00:00
michael
ab0c29e54f * Rename RawByteString version of TstringStream constructor, compiler cannot decide for empty string
git-svn-id: trunk@36759 -
2017-07-21 18:02:26 +00:00
michael
2b1bb6a5f5 * TStringStream now observes encoding, bug ID #30508
git-svn-id: trunk@36758 -
2017-07-21 17:02:37 +00:00
michael
547f08e6ea * Add TimeStamp property to TSearchRec (reworked patch from Ondrej Pokorny, bug ID #32165)
git-svn-id: trunk@36750 -
2017-07-20 07:35:51 +00:00
michael
63b4a1b7e0 Stream PPI data only when needed (Patch from Ondrej Pokorny)
git-svn-id: trunk@36749 -
2017-07-20 07:31:16 +00:00
michael
32cdee6f5d * Fix bugs 30950 & 29781
git-svn-id: trunk@36740 -
2017-07-17 16:24:05 +00:00
michael
c788256fc9 * Added AddEnumElementAliases/TypInfo.RemoveEnumElementAliases (bug ID 30961)
git-svn-id: trunk@36719 -
2017-07-10 10:00:17 +00:00
michael
bb79ab787e * Fix FULLVERSION check for randomfrom
git-svn-id: trunk@36718 -
2017-07-10 09:58:36 +00:00
michael
162b938409 * Patch from Thaddy De Koning to add generic RandomFrom
git-svn-id: trunk@36706 -
2017-07-09 10:11:01 +00:00
michael
f247a66c90 * Fix bug ID #31975, LastIndexOf string helper copy&paste error
git-svn-id: trunk@36703 -
2017-07-09 08:43:01 +00:00
michael
e9a3a807d0 * Fix overflows in intstrtodate (bug ID 32098)
git-svn-id: trunk@36687 -
2017-07-08 19:52:54 +00:00
pierre
4882b802ae Fix compilation of RTL classes unit for msdos OS target
git-svn-id: trunk@36629 -
2017-07-03 16:21:15 +00:00
Károly Balogh
ea635bfda5 typinfo: push/pop doesn't save packrecords. also, always use AlignTypeData on m68k, which might have less than pointer sized (word, 2 byte) alignments in the typeinfo, because on most systems C compilers also use 2 byte alignments, so we need that for compatibility
git-svn-id: trunk@36594 -
2017-06-24 23:18:12 +00:00
nickysn
ab0b07e7c6 * fixed off by one error in fpwidestring.Unicode2AnsiMove, which caused an
extra #0 character to the appended to the result, when converting to UTF-8

git-svn-id: trunk@36498 -
2017-06-13 23:49:28 +00:00
nickysn
5e4937fd3f * fallback to the default ansistring comparison (when doing ansistrings
comparisons), when fpwidestring is included, but no default collation has been
  set

git-svn-id: trunk@36461 -
2017-06-08 23:49:51 +00:00
nickysn
fce5fbd726 + added cp3021 (Bulgarian MIK) code page support
git-svn-id: trunk@36444 -
2017-06-07 13:19:20 +00:00
nickysn
9e74f05343 + added cp856, iso-8859-10, iso-8859-11, iso-8859-14 and iso-8859-16 to the
CodePageNames and CodePageHashes translation tables in the SysUtils unit

git-svn-id: trunk@36443 -
2017-06-07 11:55:54 +00:00
michael
f406d7cbef * Fix bug #31947: upgrade natve unicode implementation to version 9 and CLDR 30 (Patch from Inoussa)
git-svn-id: trunk@36407 -
2017-06-03 16:10:39 +00:00
nickysn
958d74e41c - removed the "else" in math.EnsureRange, because this way the compiler
generates entirely branchless code (via CMOVxx) on Pentium II or later (when
  compiling with -CpPENTIUM2)

git-svn-id: trunk@36305 -
2017-05-23 13:17:28 +00:00
marco
f0a02cdaf9 * reengineered utf8-less fix for #0031257
git-svn-id: trunk@36293 -
2017-05-22 13:58:43 +00:00
florian
69f41a776e * jump-free Ceil*/Floor* implementations
git-svn-id: trunk@36283 -
2017-05-21 12:34:31 +00:00
michael
06227c9557 * Fix bug ID #31814, StrToDateTimeDef with FormatSettings parameter
git-svn-id: trunk@36214 -
2017-05-15 13:10:56 +00:00
michael
e11821f558 * Patch from Ondrej Pokorny to make Datamodule DPI aware (bug ID 31813)
git-svn-id: trunk@36212 -
2017-05-15 07:13:37 +00:00
pierre
78343902bf Allow objpas classes and sysutils units to compile with threading support disabled
git-svn-id: trunk@36107 -
2017-05-04 22:13:11 +00:00
marco
5d317a4e46 * manual CSE for fcomponents[i] in FindComponent, mantis #31628
git-svn-id: trunk@35946 -
2017-04-25 11:34:25 +00:00
michael
e4184e0561 * Patch from Denis Kozlov to fix find in case of non-sorted list
git-svn-id: trunk@35942 -
2017-04-24 20:52:41 +00:00
michael
ac207e867b * Fix bug ID #30952
git-svn-id: trunk@35900 -
2017-04-22 12:40:51 +00:00
michael
5cd12a2521 * Better m/mm format specifier docs (bug ID 31449)
git-svn-id: trunk@35892 -
2017-04-22 10:02:29 +00:00
michael
c213a4187a * Fix bug ID #21458
git-svn-id: trunk@35607 -
2017-03-16 13:48:38 +00:00
marcus
824cabd203 Fixed textractquote regression after r35598
git-svn-id: trunk@35604 -
2017-03-16 08:04:38 +00:00
michael
e2d704cc8d * Small optimization in CompareStr as suggested in bug ID #30777
git-svn-id: trunk@35601 -
2017-03-15 21:30:19 +00:00
michael
0ee31963ed * explicit check for Nil in AnsiExtractQuotedString (bug 31212)
git-svn-id: trunk@35598 -
2017-03-15 18:05:39 +00:00
michael
4f02942b55 * Fix bug #31526, missing FixedInt FixedUInt from Delphi Berlin
git-svn-id: trunk@35560 -
2017-03-11 09:26:57 +00:00
marco
6166215174 * make istream signedness equal to MSDN and modern delphi. Denis Kozlov,
mantis #31473

git-svn-id: trunk@35542 -
2017-03-08 15:05:11 +00:00
michael
cc81abdd83 * Patch from Michal Gawrycki to implement streaming interface properties (IComponent) Bug ID
git-svn-id: trunk@35474 -
2017-02-22 21:14:35 +00:00
maciej-izak
3900ccf260 * Rename RecordOp to ManagementOp (more relevant name)
git-svn-id: trunk@35453 -
2017-02-19 18:06:54 +00:00
maciej-izak
af8e0efe57 * Rtti info about Management Operators (MO) in init table for records. Note: commit contains minimal changes for RTL (for proper "make") no functional changes. More RTL changes for fully functionally MO in next commits.
compiler/ncgrtti.pas
  + write_record_operators procedure which fills simple VMT like table for MO.
  * recorddef_rtti save MO (if exists)
  * objectdef_rtti_fields save nil pointer/entry for objects rtti (have same RTL parts like for records)

compiler/options.pas
  + new define FPC_HAS_MANAGEMENT_OPERATORS

compiler/symconst.pas
  + new item itp_init_record_operators for tinternaltypeprefix enum
  + new entry '$init_record_operators$' in internaltypeprefixName

rtl/inc/rtti.inc
  + new field RecordOp (pointer to MO VMT table) in TRecordInfoInit
  + new types to handle MO VMT: TRTTIRecordOpVMT, PRTTIRecordOpVMT, TRTTIRecCopyOp, TRTTIRecVarOp

rtl/objpas/typinfo.pp
  + RecordOp field for TRecInitData record

git-svn-id: trunk@35445 -
2017-02-19 00:22:59 +00:00
svenbarth
870bffc70d * provide access to the method table for raw interfaces (it is written even though $M is not respected by such interfaces currently)
git-svn-id: trunk@35411 -
2017-02-10 16:03:57 +00:00
svenbarth
fd1047c715 * use the correct alignment for the field following the unit name of an interface (raw or not doesn't matter)
git-svn-id: trunk@35410 -
2017-02-10 16:02:23 +00:00
michael
c3e50a36cc * Move fpdoc block after uses clause
git-svn-id: trunk@35398 -
2017-02-05 09:51:43 +00:00
michael
8d7fd39282 * Fix isNan, isInfinity, IsPositiveInfinity
git-svn-id: trunk@35356 -
2017-01-29 11:58:22 +00:00
svenbarth
060cb62f2a * correctly handle alignment for TParameterLocations
git-svn-id: trunk@35355 -
2017-01-28 16:02:09 +00:00
svenbarth
f1a5fbc0df * rename TIntfMethodEntry.ReturnLoc to ResultLocs for consistency with both ResultType and TVmtMethodParam.ParaLocs
git-svn-id: trunk@35347 -
2017-01-28 13:28:03 +00:00
svenbarth
26135d605f + implement interface RTTI inspired by the changes from Steve Hildebrandt, yet not exactly the same. Like his implementation this one isn't Delphi compatible either.
+ added test

git-svn-id: trunk@35341 -
2017-01-27 17:00:15 +00:00
svenbarth
03715bd9a8 + add data records TInterfaceData for COM and TInterfaceRawData for raw interfaces that allow for easier access to data that's only accessible by using pointers (and keeping track of alignment) without further polluting TTypeData
git-svn-id: trunk@35339 -
2017-01-27 16:53:47 +00:00
svenbarth
c6233697be + add utility properties to TPropData to access a specific TPropInfo or the end of the known data of all properties
git-svn-id: trunk@35338 -
2017-01-27 16:49:47 +00:00
svenbarth
bf2891938f + add utility properties to TPropInfo to easily access the next TPropInfo in a list of prop infos (TPropInfo.Next) or the direct, unpadded end of the known information (TPropInfo.Tail)
git-svn-id: trunk@35337 -
2017-01-27 16:47:45 +00:00
michael
f0a8355b84 * AlwaysQuote added (bug ID 31126)
git-svn-id: trunk@35333 -
2017-01-25 22:37:33 +00:00
michael
b5fb706a65 * Fix bug #31176: (Try)StrToBool should accept localized floats
git-svn-id: trunk@35331 -
2017-01-25 21:23:07 +00:00
svenbarth
3b1ae57844 * allow for AlignTypeData() to be inlined
git-svn-id: trunk@35322 -
2017-01-20 15:39:33 +00:00
svenbarth
8e510da317 * adjust AlignTypeData to take a Pointer as argument as it also needs to be used for e.g. subrecords inside TTypeData (e.g. the property table of interfaces)
git-svn-id: trunk@35321 -
2017-01-20 15:38:51 +00:00
svenbarth
e827c28722 + not only add pfResult to the compiler, but also indeed to TParamFlag
git-svn-id: trunk@35291 -
2017-01-13 16:40:09 +00:00
svenbarth
ecb878a7a7 * move PParameterLocation before TParameterLocation for consistency with all other pointer declarations in the unit
git-svn-id: trunk@35285 -
2017-01-13 16:13:18 +00:00
svenbarth
fe28403330 + two more pointer types (PPropData for TPropData and PParameterLocations for TParameterLocations)
git-svn-id: trunk@35284 -
2017-01-13 16:12:26 +00:00
svenbarth
990b0e1657 * fix TParameterLocations.GetLocation()
git-svn-id: trunk@35283 -
2017-01-13 16:11:10 +00:00
svenbarth
0dbc123557 * ensure that TRegisterType and TSubRegister have a size of 1 by moving them at the correct location
git-svn-id: trunk@35282 -
2017-01-13 16:10:17 +00:00
svenbarth
5275c36393 + extend TParamFlags by values for hidden parameters in general and especially the hidden high, self and vmt parameters (this is necessary so a manager approach for Invoke() can be used with as few knowledge about the involved calling conventions as possible)
Note: with this TParamFlags exceeds the size of a Byte

git-svn-id: trunk@35267 -
2017-01-08 16:08:35 +00:00
svenbarth
bd8a7be17e * better implementation of TProcedureParam.GetFlags that correctly handles a TParamFlags with a size > 1 even on big endian
git-svn-id: trunk@35262 -
2017-01-08 12:41:06 +00:00
svenbarth
417f1cd49d + initial implementation of the RTTI for parameter locations (not *yet* used by anything)
The parameter manager converts from the internal compiler representation of
a parameter's location to an RTTI representation. As the general implementation
more or less directly uses the compiler structures for this a platform specific
parameter manager may override this functionality in case some parameter
information changed in a non-backwards compatible way.
The RTTI parameter location has a layout that allows for an easy enumeration
as the size is fixed for all locations. Additionally there are properties that
allow for easy access to the information stored in them.

git-svn-id: trunk@35250 -
2017-01-06 22:21:37 +00:00
florian
0b82f71e8d * take care of the fact that there are 32 bit abis (e.g. ARMHF) which align qword on 8 byte boundaries, resolves issue #31132
git-svn-id: trunk@35218 -
2016-12-30 15:32:56 +00:00
marco
e6029140eb * fix for #31073
git-svn-id: trunk@35203 -
2016-12-27 16:31:14 +00:00
marco
b33da605f3 * move tendian to objpas, alias in sysutils, types. mantis #31150
git-svn-id: trunk@35202 -
2016-12-27 14:30:13 +00:00
Károly Balogh
c7576e4a3f sysutils: enable FINDHANDLE_IS_POINTER for Amiga-like systems and Atari. this allows to remove some Pointer<->THandle casts from the amicommon code
git-svn-id: trunk@35198 -
2016-12-27 03:23:54 +00:00