Commit Graph

76 Commits

Author SHA1 Message Date
florian
87702d7cda * cosmetics
git-svn-id: trunk@46211 -
2020-08-03 19:58:47 +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
marco
15fcd0ab61 * remove old ifdefs
git-svn-id: trunk@39642 -
2018-08-19 14:54:58 +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
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
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
5409450195 + ported and enabled compilation of unit sysutils for win16
git-svn-id: trunk@37734 -
2017-12-15 16:58:49 +00:00
michael
c0f183258f * Added EProgrammerNotFound and EInvalidOpException, by Silvio Clecio (bug ID 30627)
git-svn-id: trunk@34986 -
2016-11-27 15:54:06 +00:00
michael
3e96806f7e Renamed DisposeAndNil to FreeMemAndNil
git-svn-id: trunk@33378 -
2016-03-29 07:55:58 +00:00
michael
92b8bf97c0 * Added DisposeAndNil (bug ID 28895)
git-svn-id: trunk@33377 -
2016-03-29 07:33:28 +00:00
michael
231ec77175 * Delphi compatibility classes (Patch by Silvio Clecio, bug ID #29917)
git-svn-id: trunk@33362 -
2016-03-28 12:57:42 +00:00
michael
668f8eec91 * Patch from Silvio Clecio to declare EArgumentNilException (Bug ID 29850)
git-svn-id: trunk@33258 -
2016-03-16 19:10:10 +00:00
michael
4a32135563 * no type helpers in version 2.6.*
git-svn-id: trunk@32263 -
2015-11-07 09:54:43 +00:00
michael
fde42ca8ef * Type helpers, compatible to Delphi XE 8
git-svn-id: trunk@32262 -
2015-11-07 09:40:54 +00:00
michael
94e57aa463 * Moved WriteExceptionToStdErr to system unit, so it is observed even in absence of sysutils (bug ID 27708)
git-svn-id: trunk@30551 -
2015-04-12 13:58:49 +00:00
michael
bda3626025 * Write unhandled exceptions to StdErr. Option to revert back to old behaviour (Bug ID 17346)
git-svn-id: trunk@30140 -
2015-03-08 09:37:35 +00:00
svenbarth
2d454dc8fa Move DynLibs support to System unit using a manager approach like for Threads, WideStrings, etc.. This is needed so that we can support features like "delayed" and loading of dynamic packages.
Each port that allows the usage of dynamic libraries should call InitSystemDynLibs during initialization of the System unit.
The DynLibs unit has been adjusted to be a forwarder for the functions that now reside in the System unit (for backwards compatiblity just in case). Additionally the unit will register the DynLibsManager if it doesn't reside in the System unit anyway.
Currently only the Windows targets (Win32, Win64 and WinCE) implement the DynLibsManager inside the System unit. For other systems using the LoadLibrary, etc. functions will lead to a run error/exception.
If a port wants to implement its own DynLibsManager then it needs to define DISABLE_NO_DYNLIBS_MANAGER. TLibHandle, NilHandle and optionally TOrdinalEntry (it's set to SizeUInt otherwise) should be defined in sysdlh.inc which needs to be enabled using the define FPC_SYSTEM_HAS_SYSDLH (because there are targets which have FEATURE_DYNLIBS enabled, but don't support them... e.g. powerpc-wii -.-).
The DynLibsManager contains methods for loading a library based on a RawByteString and based on a UnicodeString. BOTH should be implemented, but internally one can forward to the other.
The loading by ordinal *can* be be implemented. If it is set to Nil then the implementation of GetProcAddress(lib,ordinal) will return Nil.

+ new functions SetDynLibsManager and GetDynLibsManager to set and retrieve the current DynLibsManager
* provide interface of DynLibs unit in unit System

git-svn-id: trunk@29613 -
2015-02-03 20:00:00 +00:00
nickysn
ca451988a8 * EInOutError.ErrorCode changed from Longint to Integer (16-bit Delphi 1
compatibility)

git-svn-id: trunk@27044 -
2014-03-09 13:21:27 +00:00
nickysn
73494f004d * the Exception constructors' AHelpContext parameter changed from Integer to
Longint

git-svn-id: trunk@27043 -
2014-03-09 13:09:25 +00:00
michael
77b771e91b * Let ToString return something meaningful for Exception
git-svn-id: trunk@26969 -
2014-03-06 13:34:40 +00:00
marco
ebe262762a * Clean out of $i textrec and filerec includes that are redundant now that cpstrrtl exposes
those records via system. 

git-svn-id: trunk@26356 -
2014-01-02 13:26:09 +00:00
nickysn
5e09b7a56f * SysUtils functions related to exceptions and stacktraces updated to use CodePointer
git-svn-id: trunk@25515 -
2013-09-17 21:58:53 +00:00
Jonas Maebe
2da7c3f05c * changed declarations in finah.inc and diskh.inc from ansistring to
rawbytestring
  * DoDirSeparators() and GetDirs() marked as "rtlproc" so they can accept
    non-rawbytestring arguments as their var-parameters

git-svn-id: branches/cpstrrtl@25306 -
2013-08-19 22:04:40 +00:00
Jonas Maebe
b08d8091b2 * made fexpand unicodestring-safe (use charinset instead of "in" --
"widechar in set" compiles, but results in a runtime conversion of
    the widechar into an ansistring and then getting the first character
    of that ansistring, which is horribly slow -- and Delphi-incompatible,
    but introduced a long time ago because of bug #7758)
  * replaced all "in" operations in sysutils fina.inc with CharInSet for
    the same reason
  * replaced all "string" declarations in finah.inc/fina.inc with "PathStr"
    and "pchar" with "PathPChar", and include them twice in sysutilh.inc/
    sysutils.inc, once with PathStr=UnicodeString/PathPChar=PWideChar and
    once with PathStr=AnsiString/PathPChar=PAnsiChar (not rawbytestring
    because there are several routines with var-parameters and then the
    string type has to match exactly; the "rtlproc" modifier could circumvent
    this, but should be used sparingly, and additionally the routine's
    internals would then first also have to be reviewed to ensure that at
    no point they start mixing in strings with the defaultsystemcodepage
    (e.g. directory separators) without first adjusting their codepage)
  * call GetShortPathNameA or GetShortPathNameW in ExtractShortPathName on
    Windows depending on whether we are parsing the RawByteString/UnicodeString
    version of fina.inc
  + ExpandUNCFileName(unicode) version for Windows, let its
    ExpandUNCFileName(ansistring) call the unicode version (avoid data loss
    due to ansi conversion) and convert the result to
    DefaultRTLFileSystemCodePage (to have no more data loss than what's
    specified by the user)

git-svn-id: branches/cpstrrtl@24999 -
2013-06-27 21:38:10 +00:00
nickysn
1d8d0d42a5 * size of TByteArray and TWordArray reduced by 1 on 16-bit CPUs to avoid 'structure too large' errors when compiling the sysutils unit
git-svn-id: trunk@24591 -
2013-05-25 13:28:13 +00:00
svenbarth
db6385ef33 Added exception EObjectCheck for object reference check (runtime error 210).
rtl/objpas/sysconst.pp:
  + add resourcestring SObjectCheckError
rtl/objpas/sysutilh.inc:
  + add new Exception descendant EObjectCheck
rtl/objpas/sysutils.inc:
  + use EObjectCheck with message SObjectCheckError for runtime error 210

git-svn-id: trunk@23656 -
2013-02-24 22:22:38 +00:00
svenbarth
e914ec7f00 Add platform independant support for "GetTickCount" and "GetTickCount64" to unit "SysUtils". "GetTickCount" is declared as deprecated from the beginning and thus "GetTickCount64" should be used instead.
The default implementation of "GetTickCount" just uses the lower 32-Bit from the result of "GetTickCount64". 
The default implementation of "GetTickCount64" is based upon "Now" for systems that support a floating point unit (and thus "Now"). 
Other systems can define a "SysTimerTick" function which is used instead if "HAS_SYSTIMERTICK" is defined.

The Windows implementation of "GetTickCount" uses Windows' "GetTickCount" function. 
The implemenation of "GetTickCount64" checks whether the system is a Windows Vista or newer and then uses Windows' "GetTickCount64" function. Otherwise Windows' "GetTickCount" is used also.

The Unix implementation of "GetTickCount" is the default one. 
The "GetTickCount64" implementation uses "fpgettimeofday".

git-svn-id: trunk@23215 -
2012-12-23 16:12:57 +00:00
sergei
abdbe49861 + SysUtils part of SEH (enabled only for win64)
* EExternal.ExceptionRecord changed from field to property and made available on all Windows, not just win32.
* CatchUnhandledException: removed AnsiString variable, ideally there should be no memory allocations in this code path.

git-svn-id: trunk@19849 -
2011-12-14 10:47:26 +00:00
paul
abf9816a09 rtl: add basic implementation of TEncoding class
git-svn-id: trunk@19355 -
2011-10-04 05:06:32 +00:00
paul
8f4d02ccfa rtl: add TBytes and TUnicodeCharArray types
git-svn-id: trunk@19191 -
2011-09-23 06:19:46 +00:00
paul
98f6ec4a05 rtl: raise EContructException in TCharacter constructor (compatible to delphi behavior)
git-svn-id: trunk@19189 -
2011-09-23 02:50:40 +00:00
paul
1553c8da7d rtl: add EArgumentException, EArgumentOutOfRangeException classes
git-svn-id: trunk@19182 -
2011-09-23 00:07:26 +00:00
marco
10b9f4976f * ENotImplemnted exception, Mantis 18871
git-svn-id: trunk@17083 -
2011-03-06 01:09:01 +00:00
florian
b4c912bf92 * made Byte/Word/Long/Int64Rec endian safe
+ Int128/OWordRec

git-svn-id: trunk@16279 -
2010-10-31 17:57:54 +00:00
florian
50d1008577 * superfluos empty lines removed
git-svn-id: trunk@14596 -
2010-01-10 13:24:41 +00:00
michael
01ed4a6745 * Implemented OnBeep to install custom beep handler
git-svn-id: trunk@14254 -
2009-11-22 17:33:56 +00:00
florian
5d8835861c + unicode functions for sysutils, makes tunistr6.pp compiling
git-svn-id: trunk@13402 -
2009-07-17 14:05:19 +00:00
yury
5ffec2d876 * Fixed notes: Virtual method X has a lower visibility (protected) than parent class (public).
git-svn-id: trunk@12353 -
2008-12-12 15:07:05 +00:00
joost
1a4ee73146 * Added NoWideStringSupport runtime error
git-svn-id: trunk@10618 -
2008-04-08 21:19:52 +00:00
micha
83b7f81f81 + add no-fpu support to compiler/rtl for powerpc-linux (-Cfnone)
git-svn-id: trunk@10422 -
2008-03-02 12:59:02 +00:00
michael
d7f94a8282 * Added GetModuleName
git-svn-id: trunk@9596 -
2007-12-30 21:50:40 +00:00
florian
baafccf372 + added some constants missed for compatibility, resolves #9182
git-svn-id: trunk@8121 -
2007-07-21 20:19:29 +00:00
michael
bb9d6120ed * TFormatSettings implementation, stage 1
git-svn-id: trunk@5876 -
2007-01-10 22:32:05 +00:00
florian
47fac4ee6e * moved *SSECSR to system unit
* exposed cpu feature detection on i386 from system unit
+ SafeLoadLibrary

git-svn-id: trunk@3481 -
2006-05-11 19:13:54 +00:00
Jonas Maebe
77d20627dc * removed duplicate EVariant class from varutils and incorporated
its implementation details in the EVariant class of sysutils
  + added conversions of variant error codes to exception messages
   (together these fix tw4704)

git-svn-id: trunk@3026 -
2006-03-24 22:47:15 +00:00
florian
d4bb99a5fb + runerror 214: bus error/data misaligment
git-svn-id: trunk@1263 -
2005-10-03 08:25:20 +00:00
florian
e686da2026 * fixed and removed some missing HASINLINE directives, needs more work
git-svn-id: trunk@637 -
2005-07-17 08:21:17 +00:00