summaryrefslogtreecommitdiff
path: root/rtl/bsd
diff options
context:
space:
mode:
authorsvenbarth <svenbarth@3ad0048d-3df7-0310-abae-a5850022a9f2>2015-02-03 20:00:00 +0000
committersvenbarth <svenbarth@3ad0048d-3df7-0310-abae-a5850022a9f2>2015-02-03 20:00:00 +0000
commitff8c84c9d3ec48d8da0241142fa64d0e3ae1fa58 (patch)
tree9d9792c0705b9dbe20737ea170482bed92b7a6d9 /rtl/bsd
parentb9922d03a98cd8fd9dca9216fda8eb7fabd0785c (diff)
downloadfpc-ff8c84c9d3ec48d8da0241142fa64d0e3ae1fa58.tar.gz
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: http://svn.freepascal.org/svn/fpc/trunk@29613 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'rtl/bsd')
-rw-r--r--rtl/bsd/system.pp1
1 files changed, 1 insertions, 0 deletions
diff --git a/rtl/bsd/system.pp b/rtl/bsd/system.pp
index 316840f57a..5054e5ff43 100644
--- a/rtl/bsd/system.pp
+++ b/rtl/bsd/system.pp
@@ -354,6 +354,7 @@ Begin
SetupCmdLine;
{ threading }
InitSystemThreads;
+ InitSystemDynLibs;
{ restore original signal handlers in case this is a library }
if IsLibrary then
RestoreOldSignalHandlers;