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 -
* 'mxcsr' variable made public and renamed to DefaultMXCSR.
* GetSSECSR and SetSSECSR renamed to GetMXCSR and SetMXCSR, respectively. Previous names continue to exist as deprecated aliases.
git-svn-id: trunk@27656 -
- rm ifdefs for i8086 far code memory model when doing stack traces. The
compiler will now choose the correct overload of HexStr according to the
CodePointer type.
git-svn-id: trunk@27163 -
rawbytestring
* DoDirSeparators() and GetDirs() marked as "rtlproc" so they can accept
non-rawbytestring arguments as their var-parameters
git-svn-id: branches/cpstrrtl@25306 -
o these routines are now generic wrappers in filutil.inc, and call
the platform-dependent internalfindfirst/next/close routines
o on unix, the fnmatch routine got proper support for UTF-8 matching
(e.g., it won't match a partial UTF-8 code point to a "?" wildcard)
o for NativeNT, a similar (untested) UTF-16 version has been added
+ test for the above
* rawbytestring/unicodestring versions of fileage
git-svn-id: branches/cpstrrtl@25302 -
CreateDir and RemoveDir, and implemented a generic one (based on the OS/2
version) in the shared sysutils code (so that the filesystem code page
support for the system unit routines can be reused)
* include both ansistring and unicodestring versions of the above routines,
and of ForceDirectories. Exception: GetCurrentDir, which cannot be
overloaded based on function result and whose return type currently
dependends on the FPC_UNICODE_RTL define
git-svn-id: branches/cpstrrtl@25113 -
* moved the inclusion of sysansi.inc to before the inclusion of all other
sysutils include files so the inline body of CharInSet is available
git-svn-id: branches/cpstrrtl@25000 -
"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 -
o resolved conflict in updated morphos sysutils unit
o moved code that had been added to the now deleted sysunix.inc to the
unix-specific block of the fpwidestring unit's init code
git-svn-id: branches/cpstrrtl@24913 -
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 -
The WinCE implementation converts the rawbytestring arguments to
unicodestring and calls unicode OS APIs, while the others convert
unicodestring arguments to DefaultFileSystemCodePage and call
single byte OS APIs
+ test for the above
git-svn-id: branches/cpstrrtl@22467 -
* 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 -
* Some Delphi-compatible changes:
* For floating point underflow condition, raise EUnderflow, not EOverflow.
* For unknown codes, raise EInOutError, not Exception.
* Added entries for EZeroDivide and EStackOverflow (actually raising EZeroDivide on floating-point division by zero requires further changes to System because currently both integer and float division by zero is mapped to the same code 200).
git-svn-id: trunk@19707 -
Options now include stripquotes
* Changed ExeSearch so dirlist is optional and PATH is used if omitted.
It uses stripQuotes on windows. (bug 19282)
git-svn-id: trunk@17717 -
* return value of GetLastOSError if one is available, to be consistent with handle-based implementations and Delphi behavior.
* otherwise, return -1
git-svn-id: trunk@16318 -
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 -