- Use the CommandLineToArgvW API function to parse the Unicode command line (we can use it since Win9x is not supported anymore).
- Implemented non-public functions ParamStrA and ParamStrU which are exposed in the objpas and uuchar units to provide correct AnsiString and UnicodeString versions of ParamStr().
- The cleanup code is moved from InternalExit to the finalization section of the System unit.
git-svn-id: trunk@45037 -
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 -
+ 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 -
* changed all mappings from CP_ACP to DefaultSystemCodePage to calls to the
new TranslatePlaceholderCP() routine (which also handles CP_OEMCP)
* removed unnecessary CP_ACP adaptations in fpc_AnsiStr_Concat_multi()
for JVM target (now handled in the ansistring to unicodestring conversion
routine)
git-svn-id: branches/cpstrrtl@25091 -
* renamed platform-specific pchar versions of those rouines to do_*() and
changed them to either rawbytestring or unicodestring depending on the
FPCRTL_FILESYSTEM_SINGLE_BYTE_API/FPCRTL_FILESYSTEM_TWO_BYTE_API setting
* implemented generic shortstring versions of those routines on top of either
rawbytestring or unicodestring depending on the API-kind (in case of the
embedded target, if ansistring are not supported they will map directly
to shortstring routines instead)
* all platform-specific *dir() routines with rawbytestring parameters now
receive their parameters in DefaultFileSystemCodePage
- removed no longer required ansistring variants from the objpas unit
- removed no longer required FPC_SYS_MKDIR etc aliases
* factored out empty string and inoutres<>0 checks from platform-specific
*dir() routines to generic ones
o platform-specific notes:
o amiga/morphos: check new pathconv(rawbytestring) function
o macos TODO: convert PathArgToFSSpec (and the routines it calls) to
rawbytestring
o nativent: added SysUnicodeStringToNtStr() function
o wii: convert dirio callbacks to use rawbytestring to avoid conversion
+ test for unicode mk/ch/rm/getdir()
git-svn-id: branches/cpstrrtl@25048 -
getdir(rawbytestring):rawbytestring so it can accept strings in any
encoding and cleanly return results in DefaultRTLFileSystemCodePage
+ getdir(unicodestring):unicodestring
* renamed the getdir implementation of all platforms except for embedded-
without-ansistring-support to do_getdir(), and depending on the
FPCRTL_FILESYSTEM_SINGLE_BYTE_API/FPCRTL_FILESYSTEM_TWO_BYTE_API define
changed its shortstring parameter to ansistring or unicodestring. The
do_getdir(rawbytestring) routine should just set the code page of the
return value to DefaultFileSystemCodePage without conversion (not
DefaultRTLFileSystemCodePage with conversion, that conversion is performed
in getdir if necessary; this avoids double conversions in case
getdir(unicodestring) is called)
+ generic getdir(shortstring) for platforms supporting either ansistrings or widestrings
o platform maintainers:
o OS/2: adjust code to supports paths > 255 characters if those are supported
o Wii: adjust used callback to use rawbytestring to support paths > 255 characters and
avoid shortstring->rawbytestring conversion overhead
o Windows: GetCurrentDirectoryW is now always used (to prevent data loss)
git-svn-id: branches/cpstrrtl@24993 -
Also adjusted all Windows (Win32/64/CE) units to define a "UNICODE" if "FPC_OS_UNICODE" is defined (except the Jedi units).
Also the common RTL units that checked for UNICODE now check for FPC_OS_UNICODE.
git-svn-id: trunk@24420 -
* systlsdir.inc: don't invent own symbols for the same purpose, defining DLL_xx conditionally is enough to avoid duplicate declarations.
git-svn-id: trunk@20363 -
Used to support TlsCallbacks.
Tls callback code added inside
ifdef FPC_USE_TLS_DIRECTORY.
NOTE: This code needs compiler changes also to work.
* win/systhread.inc:
Exec_Tls_callback: Callback for main executable.
Several new external variables:
FreePascal_TLS_callback, FreePascal_end_of_TLS_callback
need to be placed into .CRT$XL* section,
using name '.section .CRT$XLFPC __FPC_tls_callbacks'
extension to be provided by compiler change.
tls_callbacks : pointer; external name '___crt_xl_start__';
tls_data_start : pointer; external name '___tls_start__';
tls_data_end : pointer; external name '___tls_end__';
provided by linker script.
tls_index : DWord that will contain the automatic
TlsIndex generated by executable launch code (not used by
FPC code, but might be used by code from loaded objects).
_tls_used: TTlsdirectory record.
* win32/system.pp and win64/system.pp:
Code to force loading of _tls_used record.
git-svn-id: trunk@17893 -
svn+ssh://svn.freepascal.org/FPC/svn/fpc/branches/resources
........
r9694 | michael | 2008-01-09 21:31:18 +0100 (Wed, 09 Jan 2008) | 1 line
* Initial check-in
........
r9695 | michael | 2008-01-09 21:35:58 +0100 (Wed, 09 Jan 2008) | 1 line
* New version from Giulio Bernardi
........
r9697 | michael | 2008-01-09 21:41:54 +0100 (Wed, 09 Jan 2008) | 1 line
* Patch from Giulio Bernardi with resource support
........
r9698 | michael | 2008-01-09 21:46:33 +0100 (Wed, 09 Jan 2008) | 1 line
* Patch from Giulio Bernardi to add more resource testing
........
r9699 | michael | 2008-01-09 21:57:26 +0100 (Wed, 09 Jan 2008) | 1 line
* New tool from Giulio Bernardi
........
r9700 | michael | 2008-01-09 21:58:23 +0100 (Wed, 09 Jan 2008) | 1 line
* New tool from Giulio Bernardi
........
r9701 | michael | 2008-01-09 22:01:54 +0100 (Wed, 09 Jan 2008) | 1 line
* Added fcl-res
........
r9702 | michael | 2008-01-09 22:01:58 +0100 (Wed, 09 Jan 2008) | 1 line
* Added fcl-res
........
r9703 | michael | 2008-01-10 08:54:26 +0100 (Thu, 10 Jan 2008) | 1 line
* Fixed double code
........
r9704 | jonas | 2008-01-10 10:59:20 +0100 (Thu, 10 Jan 2008) | 2 lines
- removed duplicate code
........
r9705 | jonas | 2008-01-10 11:25:21 +0100 (Thu, 10 Jan 2008) | 2 lines
+ added missing fcl-res dependencies
........
r9706 | jonas | 2008-01-10 11:58:30 +0100 (Thu, 10 Jan 2008) | 2 lines
+ dependencies for fpintres and fpextres
........
r9707 | yury | 2008-01-10 12:47:51 +0100 (Thu, 10 Jan 2008) | 3 lines
* Fixed compilation of resource, which is included in a unit located in different folder than main source.
* .res files must be copied to units output folder, otherwise .res files will not be found when only compiled units path is available and compiler does not know anything about sources folder.
* Improved resource related error messages.
........
r9708 | michael | 2008-01-10 12:52:13 +0100 (Thu, 10 Jan 2008) | 1 line
* Removed double source after end.
........
r9709 | michael | 2008-01-10 12:52:48 +0100 (Thu, 10 Jan 2008) | 1 line
* No longer needed
........
r9710 | tom_at_work | 2008-01-10 22:09:08 +0100 (Thu, 10 Jan 2008) | 1 line
* properly align FPC_RESLOCATION so that linking does not fail on some architectures (e.g. ppc64)
........
r9711 | tom_at_work | 2008-01-10 23:53:12 +0100 (Thu, 10 Jan 2008) | 1 line
* fix splitting of 64 bit load/stores from/to unaligned memory locations into multiple load/stores, which in some cases generated wrong code
........
r9712 | michael | 2008-01-11 11:00:08 +0100 (Fri, 11 Jan 2008) | 1 line
* Fixed bug in BSS section on 64-bit platforms
........
r9720 | giulio | 2008-01-12 10:02:04 +0100 (Sat, 12 Jan 2008) | 1 line
Updated fcl-res documentation: occurrences of reslib changed to fcl-res.
........
r9740 | giulio | 2008-01-13 19:36:44 +0100 (Sun, 13 Jan 2008) | 3 lines
- Don't try to compile resources on systems with a non windows-like resource support.
- Don't add the .or file to the list of object files if resource compiling failed.
........
r10201 | giulio | 2008-02-04 11:35:44 +0100 (Mon, 04 Feb 2008) | 5 lines
* resource compiling supported on OS/2 via wrc
* CompileResourceFiles and CollectResourceFiles don't do target-specific checks anymore
* refactored a bit
........
r10389 | giulio | 2008-02-25 21:32:52 +0100 (Mon, 25 Feb 2008) | 2 lines
Deleted test file which was committed by mistake
........
r10472 | giulio | 2008-03-10 12:22:18 +0100 (Mon, 10 Mar 2008) | 2 lines
changed define FPC_HAS_RESOURCES to FPC_HAS_WINLIKERESOURCES
........
git-svn-id: trunk@10481 -
+ Added new target WinCE for i386 (to be able compile and run programs in WinCE emulator)
+ Exceptions work now.
* System unit seems to be fully working
git-svn-id: trunk@597 -