* asc* uni* versions become pointer variants.
* delphi overloads move to redef.
* remove old comment (<2005) from redef. Possible related to constness. (LPCSTR vs LPSTR)
* also added $ifdef unicode version. Most redefs don't.
git-svn-id: trunk@41555 -
- (probably Copy and paste) error in emrpolyline16
- EMREXTCREATEFONTINDIRECTW.elfw is of a W type
- a few missing ^ pointer to's.
git-svn-id: trunk@40842 -
Note that the enumfont* functions seem to use the var prototypes, while only redef functions should use them. Probably not worth breaking compat for though (in since 2016)
git-svn-id: trunk@39480 -
rtl/inc/systemh.inc & rtl/java/jsystemh_types.inc:
- TEntryInformation: remove WideInitTables
rtl/win/sysosh.inc:
+ TEntyrInformationOS: add WideInitTables
rtl/win/syswin.inc:
* adjust WStrInitTablesTable, so that it is now a pointer and can be used both with direct and indirect main entry
* InitWin32Widestrings: WStrInitTablesTable is now a pointer
rtl/win32/sysinit.inc:
* WideInitTables has moved to the OS specific part of the entry information
rtl/win32/system.pp:
* OsSetupEntryinformation: setup WStrInitTablesTable
git-svn-id: trunk@33571 -
win/sysosh.inc, TEntryInformationOS:
+ new field SysInstance that will hold the address to the main program's SysInstance variable
win32/system.pp:
* rename SysInstance to FPCSysInstance and make it a PLongInt
* OsSetupEntryInformation: setup FPCSysInstance
* adjust initialization of SysInstance to use FPCSysInstance instead
win32/sysinit.inc:
* SysInstance is no longer an external
* initialize the OS.SysInstance field of EntryInformation
win64/system.pp:
* add a FPCSysInstance that's a pointer to SysInstance
win/winres.inc:
* SysInstance is now a pointer and has the same name on both Win32 and Win64
git-svn-id: trunk@33107 -
rtl/inc/system.inc:
* SetupEntryInformation: call new, optional function OSSetupEntryInformation to handle platform specific entry information initialization
rtl/win/sysosh.inc, TEntryInformationOS:
+ new field TlsKeyAddr which will hold the address to the main binary's TlsKey variable
win32/sysinit.inc:
+ provide the variable holding the TlsKey and pass that on to the entry information record
win32/system.pp:
+ new OS specific entry information initialization (currently only the TlsKey)
win/systhrd.inc:
* declare TlsKey as a pointer to a DWord value instead of a DWord; on non-indirect entry platforms this is initialized with the address of new variable TlsKeyVar, on indirect entry platforms it will be initialized by the entry information initialization
* adjust usages of TlsKey from DWord to PDWord
win/systlsdir.inc:
* TlsKey is now a PDWord and (in sysinit) points to TlsKeyVar
win/syswin.inc:
* adjust TlsKey usage
inc/heaptrc.pp:
* TlsKey is now a PDWord, thus adjust the import and the usage
git-svn-id: trunk@33091 -
rtl/inc/system.inc:
* provide a public alias for SetupEntryInformation so that it can be used in SysInit as well without globally exporting it
rtl/win/systlsdir.inc:
* Exec_tls_callback: call SetupEntryInformation before initalizing the heap and multithreading so that the threadvar tables can be referenced correctly
git-svn-id: trunk@33035 -
rtl/inc/system.inc:
+ new variables that hold pointers to the tables
+ new procedure SetupEntryInformation() that should be used in the entry points of indirect entry targets to setup cross target fields
+ for direct entry targets the two resource string tables are imported here and supplied as initialization to the table pointers
objpas/objpas.pp:
* adjust table declarations so that the pointers provided from the System unit are used
* adjust usages of the tables as they are now pointers
win32/system.pp:
* Exe_Entry: use SetupEntryInformation()
win/syswin.inc:
* Dll_Entry: use SetupEntryInformation()
git-svn-id: trunk@33028 -
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 -
rtl/win/sysos.inc:
+ add definition of TSystemInfo structure
+ add import of GetSystemInfo
+ add implementation of GetCPUCount which returns value for number of processors retrieved by GetSystemInfo
git-svn-id: trunk@28643 -
* Deprecated StartupInfo variable because it is not there for Delphi compatibility (Delphi apparently does not have such variable in interface of its System unit), and we don't have other reasons to export non-portable stuff.
git-svn-id: trunk@26810 -
o since we always use UTF-16 for OS file API calls, this will only affect
possible intermediate code page conversions inside RTL routines and hence
prevent potential data loss. This was already the same for NativeNT and
WinCE, which are in the same boat
o DefaultRTLFileSystemCodePage, which specifies the code page used to return
strings from single byte RTL routines, remains CP_ACP and hence nothing
will change as far as programs using the RTL are concerned
git-svn-id: trunk@26377 -
Although basic things work (no regressions in test suite, also with TEST_OPT=-O2), there are some secondary issues/TODOs:
- Exception frame around PASCALMAIN is not properly removed in DLLs
- No stack traces yet
- Stack overallocated in finalizer procedures, their entry/exit code needs cleanup
- Signals unit is probably completely broken.
git-svn-id: trunk@26225 -
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 -
+ codepage support for textrec/filerec and the above routines
* textrec/filerec now store the filename by default using widechar. It is
possible to switch back to ansichars using the FPC_ANSI_TEXTFILEREC define.
In that case, from now on the filename will always be stored in
DefaultFileSystemEncoding
* fixed potential buffer overflows and non-null-terminated file names in
textrec/filerec
+ dodirseparators(pwidechar), changed the dodirseparators(pchar/pwidechar)
parameters into var-parameters and gave those routines an extra parameter
that indicates whether the p(wide)char can be changed in place if
necessary or whether a copy must be made first (avoids us having to make
all strings always unique everywhere, because they might be changed on
some platforms via a pchar)
* do_open/do_erase/do_rename got extra boolean parameters indicating whether
the passed pchars point to data that can be freely changed (to pass on to
dodirseparators() if applicable)
* objects.pp: force assign(pchar) to be called, because
assign(array[0..255]) cannot choose between pchar and rawbytestring
versions (and removing the pchar version means that assign(pchar) will
be mapped to assign(shortstring) in {$h-})
* fixed up some routines in other units that depend on the format of
the textrec/filerec.name field
git-svn-id: branches/cpstrrtl@25137 -
so declarations can also depend on it and similar defines (not yet the
case)
+ added SYSUTILS_HAS_ANSISTR_ENVVAR_IMPL/SYSUTILS_HAS_UNICODESTR_ENVVAR_IMPL
to indicate whether the platform-dependent part of the unit provides
an ansistring/unicodestring interface to get environment variables
+ Windows version of getenvironmentvariable(unicodestring)
+ generic ansistring/unicodestring versions of GetEnvironmentVariable()
in case the platform doesn't provide them
* result of GetEnvironmentString() is ansistring/unicodestring depending
on the state of the FPC_RTL_UNICODE define
git-svn-id: branches/cpstrrtl@25116 -