Commit Graph

49 Commits

Author SHA1 Message Date
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
sergei
3a5e6485b5 - RTL: removed InitVariantManager, it was an empty procedure since day 1.
git-svn-id: trunk@29114 -
2014-11-22 20:35:46 +00:00
sergei
9801288cdc * Removed SysInitFPU/SysResetFPU from (remaining) system units initialization code. It is redundant there because it is called from fpc_cpuinit, or, in case of i386, from fpc_cpucodeinit.
* It fixes regression of tw16283b after r27169. 
* BeOS, Haiku: added fpc_cpucodeinit to compensate for removal of SysInitFPU, it also enables use of CPU features like SSE.

git-svn-id: trunk@27171 -
2014-03-17 10:53:52 +00:00
yury
2b2a68446d * Added new unit unixcp. It contains stuff from winiconv.inc - a table to map Windows code page identifiers to locale names on unix. Also GetSystemCodePage function in this unit can be used to detect which code page is used currently.
* Build unixcp for all unix-like systems.
* Use the unixcp unit in cwstring instead of winiconv.inc.
- Deleted winiconv.inc
- Reverted r22410,r22411,r22428. The compiler will use the unixcp unit to get a default code page for ansistrings.

git-svn-id: trunk@23670 -
2013-02-28 18:21:28 +00:00
paul
88a10330c2 rtl: initialize DefaultSystemCodePage on aix,beos,haiku,solaris
git-svn-id: trunk@22428 -
2012-09-21 01:45:18 +00:00
paul
1ccf16358c rtl: init widestring and unitcodestring managers before initialization of Standard IO files (stdin,stdout,stderr)
git-svn-id: trunk@19542 -
2011-10-25 02:29:29 +00:00
olivier
16de86ef7c - Remove unnecessary call to SysInitStdIO probably added here by me for debugging purpose long time ago. The right one is a few line below.
git-svn-id: trunk@15098 -
2010-03-30 20:06:52 +00:00
olivier
8aaa5ee123 The unit name should start with an upper case to pass tobject5.pp test under BeOS (not tested yet ;-).
git-svn-id: trunk@15035 -
2010-03-23 00:24:42 +00:00
Jonas Maebe
f6d452c2c0 * remove the RTL's installed signal handlers at the end of the system
unit's initialization code in case we're in a library
  + implemented InquireSignal(), AbandonSignalHandler(), HookSignal() and
    UnhookSignal() in the sysutils unit
  * for Kylix compatibility, these routines support operating on
    SIGINT and SIGQUIT as well, although they are not hooked by default
    by FPC. The run time errors/exception codes for these signals are
    resp. 217 and 233 (same as in Kylix; I changed ENoWideStringSupport
    to 234).
  * changed the BSD syscall version of fpsigaction to use pointer
    rather than "var" arguments (compatible with other targets, and
    required to be able to pass nil arguments inside the system unit)
  -> together fixes mantis #12704

git-svn-id: trunk@13077 -
2009-05-02 09:40:44 +00:00
Jonas Maebe
1f6ec36064 * save/restore errno inside reenable_signal, because it can be called
from inside signal handlers

git-svn-id: trunk@12997 -
2009-04-04 09:59:41 +00:00
Jonas Maebe
d4d7b695c7 - removed all "islibrary:=false;" assignments from system unit
initialisation code, because that's a typed constant already initialised
    to that value and it interferes with a generic solution to set islibrary
    to true for libraries

git-svn-id: trunk@12376 -
2008-12-17 17:48:04 +00:00
florian
f97c2968f9 * fixed widestring/unicodemanager initialisiation
git-svn-id: trunk@11743 -
2008-09-10 21:02:50 +00:00
Jonas Maebe
57087da620 * return an empty string for paramstr(value>paramcount) (already correct
for other targets, mantis #11169)

git-svn-id: trunk@10704 -
2008-04-18 16:56:44 +00:00
peter
5acb3649df * revert r9557, the performance impact is to big for an academic corner
case optimziation

git-svn-id: trunk@9603 -
2007-12-31 13:36:16 +00:00
yury
0dcad4d822 * Implemented late thread manager initialization. Thread manager code is not included to executable if thread stuff are not used. WinCE executable size is reduced by 4KB, Win32 executable size is reduced by 3KB. No testsuite regressions.
git-svn-id: trunk@9557 -
2007-12-28 14:40:28 +00:00
florian
04086e9df2 * SysResetFPU fix for BeOS by Olivier Coursiere
git-svn-id: trunk@9010 -
2007-10-30 22:00:58 +00:00
florian
bcd5fc555a * rtl part of Olivier Coursier's BeOS patch
git-svn-id: trunk@8396 -
2007-09-07 19:25:05 +00:00
florian
271c970e9d * rtl part of BeOS patch from Olivier Coursiere
git-svn-id: trunk@7438 -
2007-05-24 06:52:50 +00:00
Tomas Hajny
f29fde8978 * CheckInitialStkLen and/or StackLength initialization added to previously omitted targets
git-svn-id: trunk@1736 -
2005-11-13 19:13:16 +00:00
tom_at_work
1b4b42fdd6 * added CheckInitialStkLen() function which checks whether the given stack size value is valid on the OS when creating a thread, fixing stack checking
git-svn-id: trunk@1722 -
2005-11-11 12:16:08 +00:00
michael
21425e303c + Removed HASVARIANT define
git-svn-id: trunk@244 -
2005-06-07 20:48:31 +00:00
michael
8a226bba52 + Removed HASWIDESTRING/HASWIDECHAR defines
git-svn-id: trunk@241 -
2005-06-07 20:42:22 +00:00
fpc
790a4fe2d3 * log and id tags removed
git-svn-id: trunk@42 -
2005-05-21 09:42:41 +00:00
peter
b68af1b0e3 * post 2.0.0 fixes from cvs
git-svn-id: trunk@7 -
2005-05-16 20:59:02 +00:00
fpc
50778076c3 initial import
git-svn-id: trunk@1 -
2005-05-16 18:37:41 +00:00
michael
2e48181661 + Added maxpathlen constant (maximum length of filename path) 2005-05-12 20:29:04 +00:00
florian
4aa4aeae79 + TThreadID 2005-04-13 20:10:50 +00:00
Tomas Hajny
d3c103dfd7 * EOF_CTRLZ conditional define replaced with CtrlZMarksEOF, #26 handling made more consistent (fix for bug #2453) 2005-04-03 21:10:59 +00:00
peter
e417e34496 * truncate log 2005-02-14 17:13:06 +00:00
florian
4f7560d89e * improved widestring infrastructure manager 2005-02-01 20:22:49 +00:00
Tomas Hajny
353d5cc3de + GetProcessID added 2004-12-05 14:36:37 +00:00
peter
dbc2025604 ErrOutput added 2004-11-04 09:32:31 +00:00
peter
869b0ecc85 * compiler defined HEAP and HEAPSIZE removed 2004-10-25 15:38:59 +00:00
Tomas Hajny
d3b5672fea * handle type changed to thandle in do_isdevice 2004-09-18 11:18:44 +00:00
olle
9a4855aa43 + added maxExitCode to all System.pp
* constrained error code to be below maxExitCode in RunError et. al.
2004-09-03 19:25:21 +00:00
olle
b76126f91b + cleanup 2004-06-21 18:50:51 +00:00
peter
2ed14823c5 * New heapmanager that releases memory back to the OS, donated
by Micha Nelissen
2004-06-17 16:16:13 +00:00
peter
041eb4aa1d * do_read/do_write addr argument changed to pointer 2004-04-22 21:10:56 +00:00
Tomas Hajny
e0f9297e01 * ExecuteProcess fixes, ProcessID and ThreadID added 2004-01-20 23:05:31 +00:00
Tomas Hajny
57538cb669 * THandle in sysutils common using System.THandle 2003-10-25 23:42:35 +00:00
peter
3d8d9c96f8 * sbrk returns pointer 2003-09-27 11:52:35 +00:00
marco
97533b60f8 * Small fixes and quick merge with 1.0.x. At least the compiler builds now,
but it could crash hard, since there are lots of unimplemented funcs.
2003-01-08 22:32:28 +00:00
florian
0c288217db - removed stack check, it's system independend in 1.1 2003-01-05 20:22:24 +00:00
florian
4051df8494 + fixed missing SysInitStdIO 2003-01-05 20:06:30 +00:00
florian
495cb55113 + call to initvariantmanager inserted 2002-10-13 09:25:14 +00:00
peter
9f31783a0a * old logs removed and tabs fixed 2002-09-07 16:01:16 +00:00
Tomas Hajny
0b672785fb * platform specific constants moved after systemh.inc, BeOS omission corrected 2001-06-19 20:46:07 +00:00
Tomas Hajny
72e3212dad + platform specific information 2001-06-13 22:20:10 +00:00
peter
3a02f304b0 * BeOS target! 2001-06-02 19:26:03 +00:00