Commit Graph

20 Commits

Author SHA1 Message Date
Tomas Hajny
dbc50980d1 * fixed OS/2 compilation after dynlibs manager implementation
git-svn-id: trunk@29617 -
2015-02-03 23:56:12 +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
Tomas Hajny
6c17c9cb29 * minor optimization (don't clear the result of GetDynLibsErrorStr twice)
git-svn-id: trunk@28948 -
2014-10-30 14:52:34 +00:00
Tomas Hajny
8cd2b615ce * added (limited) GetLastOSError by emulation of Win32 and *nix behaviour in the RTL
git-svn-id: trunk@28947 -
2014-10-30 14:44:03 +00:00
Tomas Hajny
1a430d8110 * GetProcAddr added for OS/2, type of argument for ordinal target specific now
git-svn-id: trunk@26521 -
2014-01-19 21:15:26 +00:00
Jonas Maebe
3fdb3092af + defaultfilesystemcodepage support for dynlibs
+ unicodestring overloads for (safe)loadlibrary()

git-svn-id: branches/cpstrrtl@25162 -
2013-07-22 21:45:34 +00:00
Tomas Hajny
d066a78559 * fix breakage after writestr changes in r23888
git-svn-id: trunk@24773 -
2013-06-02 13:39:32 +00:00
Tomas Hajny
2bcfe75ea8 * correction for copy&paste error in previous commit
git-svn-id: trunk@21908 -
2012-07-12 23:32:51 +00:00
Tomas Hajny
4dccf2d321 * GetLoadErrorStr implemented
git-svn-id: trunk@21907 -
2012-07-12 23:30:19 +00:00
michael
8eeb22720b * Added GetLoadErrorStr function by Mark Morgan Loyd (Bug ID 22321)
git-svn-id: trunk@21880 -
2012-07-11 15:31:09 +00:00
sergei
cbdc08b641 * dynlibs.pas: added 'const' modifiers to eliminate unnecessary local string copies
git-svn-id: trunk@16366 -
2010-11-18 22:09:48 +00:00
Tomas Hajny
5c31042f6a * SharedSuffix moved to include files to reduce number of ifdefs
git-svn-id: trunk@14902 -
2010-02-13 15:44:12 +00:00
peter
4ace790492 * remove $Log
git-svn-id: trunk@231 -
2005-06-07 09:47:55 +00:00
fpc
790a4fe2d3 * log and id tags removed
git-svn-id: trunk@42 -
2005-05-21 09:42:41 +00:00
fpc
50778076c3 initial import
git-svn-id: trunk@1 -
2005-05-16 18:37:41 +00:00
peter
e417e34496 * truncate log 2005-02-14 17:13:06 +00:00
Tomas Hajny
26141a5440 * wrong condition for DosLoadModule 2004-10-24 11:44:27 +00:00
peter
9f31783a0a * old logs removed and tabs fixed 2002-09-07 16:01:16 +00:00
Jonas Maebe
8eb96135c8 * fixed compiling error 2000-09-29 21:51:00 +00:00
Tomas Hajny
121ee1eee2 + OS/2 implementation 2000-08-23 21:04:55 +00:00