Commit Graph

1107 Commits

Author SHA1 Message Date
Jonas Maebe
679c6bd27e * fixed formatting
git-svn-id: trunk@26149 -
2013-11-27 20:27:20 +00:00
Jonas Maebe
cddc31a1a8 * also allow 'cpXXXX' in addition to 'CPXXXX' code page names (mantis #15169)
git-svn-id: trunk@26148 -
2013-11-27 20:27:16 +00:00
Jonas Maebe
cada770f9e * changed return value in case of failure in ThreadManager.SemaphoreInit
from nil to pointer(-1), because nil/0 is a valid return value for
    sem_open() on some platforms

git-svn-id: trunk@26079 -
2013-11-13 16:51:11 +00:00
svenbarth
fbceb574eb Fix for Mantis #25041 . Correctly set CurrentThreadVar for those tthread.inc incarnations that don't use the default ThreadProc in classes.inc (this should be changed in the future though...). In addition to Unix systems as described by the bug report this also involved BeOS and Netware LibC.
+ added test

git-svn-id: trunk@25511 -
2013-09-17 18:02:12 +00:00
nickysn
129fddf800 * fixed compilation of unit crt on linux
git-svn-id: trunk@25507 -
2013-09-17 11:25:47 +00:00
nickysn
96c7a9325a * CrtOpen, CrtClose, CrtRead, CrtWrite and CrtReturn changed to procedures, instead of functions
git-svn-id: trunk@25506 -
2013-09-17 11:17:29 +00:00
Jonas Maebe
f9f041d470 * SystemOldNAme -> SystemOldName
git-svn-id: branches/cpstrrtl@25304 -
2013-08-19 22:04:33 +00:00
Jonas Maebe
af3f12f60c * rawbytestring/unicodestring versions of findfirst/findnext/findclose
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 -
2013-08-19 22:04:25 +00:00
Jonas Maebe
29132f45b7 * synchronised with trunk up to r25167 (fixes glib compilation via r25164,
and occasional crashes in executeprocess on libc platforms via r25167)

git-svn-id: branches/cpstrrtl@25169 -
2013-07-24 14:24:49 +00:00
Jonas Maebe
832b902df6 * ordered the declarations the same was as in bunxh.inc, so it's easier
to see what's missing
  + added missing declarations for fpexecv (causing an unnecessary
    slowdown in executeprocess due to it calling the ansistring overload),
    fplink, fpwait and fpsetrlimit
  * changed sigset parameters of FpSigSuspend and FpSigTimedWait from const
    into constref, since they must be passed by reference

git-svn-id: trunk@25167 -
2013-07-24 13:49:35 +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
Jonas Maebe
df6a2dce00 + unicodestring support for assign/erase/rename
+ 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 -
2013-07-19 16:30:51 +00:00
Jonas Maebe
953e088c14 + unicodestring support for POpen(), and DefaultFileSystemCodePage support
for POpen(RawByteString)

git-svn-id: branches/cpstrrtl@25134 -
2013-07-19 16:29:13 +00:00
Jonas Maebe
8538f48fda * made the ansistring parameters of the fp*() overloads constant, changed
them to rawbytestring and added DefaultFileSystemCodePage conversions

git-svn-id: branches/cpstrrtl@25133 -
2013-07-19 16:28:49 +00:00
Jonas Maebe
155aafc255 * moved SYSUTILS_HAS_ANSISTR/UNICODESTR_FILEUTIL_IMPL define to interface
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 -
2013-07-16 14:16:34 +00:00
Jonas Maebe
eeb98a0c0f - removed platform-specific implementations of GetCurrentDir, SetCurrentDir,
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 -
2013-07-16 14:15:55 +00:00
Jonas Maebe
06d9b35ed3 * don't truncate the result of GetEnvironmentVariable to 255 characters
git-svn-id: branches/cpstrrtl@25105 -
2013-07-15 09:21:51 +00:00
Jonas Maebe
26b2149ced * converted the following sysutils routines to unicodestring and
rawbytestring: FileExists, DirectoryExists, FileSetDate, FileGetAttr,
    FileSetAttr, DeleteFile, RenameFile, FileSearch, ExeSearch,
    FileIsReadOnly

git-svn-id: branches/cpstrrtl@25078 -
2013-07-09 19:01:45 +00:00
Jonas Maebe
d66d15aad3 + added mkdir/chdir/rmdir(rawbytestring) and (unicodestring) to the system unit
* 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 -
2013-07-04 22:28:37 +00:00
sergei
40045e6269 - Removed unused variables
git-svn-id: trunk@25005 -
2013-06-28 11:53:10 +00:00
Jonas Maebe
62ee16278b * changed getdir(ansistring):ansistring to
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 -
2013-06-27 21:37:47 +00:00
Jonas Maebe
ecd3cba02b * synchronised with trunk up to r24912
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 -
2013-06-17 20:50:02 +00:00
marco
07e23b8401 * mousebutton 4 and 5 support (gpm only?) Mantis #13469
git-svn-id: trunk@24164 -
2013-04-06 18:58:05 +00:00
Jonas Maebe
f00d9f6f84 * correct dlopen flag values for Darwin (patch by lks, mantis #23979)
git-svn-id: trunk@23771 -
2013-03-10 10:22:43 +00:00
marco
9f53738142 * fill in purpose of the unit in comment, updated copyright
git-svn-id: trunk@23725 -
2013-03-08 09:18:26 +00:00
pierre
f4b6625145 + Use __setlocale_mb_len_max_32 for netbsd as suggested by linker warning
git-svn-id: trunk@23696 -
2013-03-05 11:40:24 +00:00
yury
5bf237afc1 * Turn off assigning UnixGetModuleByAddrHook for Android, since dladdr() function is not available on old (1.x) Android versions.
git-svn-id: trunk@23695 -
2013-03-05 00:00:02 +00:00
yury
5e369ae7fc * Use UTF-8 as fallback code page on linux and ASCII on other unix systems.
git-svn-id: trunk@23680 -
2013-03-02 09:51:05 +00:00
yury
c4ba95b227 * Use CP_ASCII as fallback in GetSystemCodepage to be compatible with cwstring.
git-svn-id: trunk@23676 -
2013-03-01 08:44:05 +00:00
yury
b0d79b7854 * Use UTF-8 as fallback in GetSystemCodepage.
git-svn-id: trunk@23673 -
2013-02-28 19:48:56 +00:00
yury
2b2a68446d * Added new unit unixcp. It contains stuff from winiconv.inc - a table to map Windows code page identifiers to locale names on unix. Also GetSystemCodePage function in this unit can be used to detect which code page is used currently.
* Build unixcp for all unix-like systems.
* Use the unixcp unit in cwstring instead of winiconv.inc.
- Deleted winiconv.inc
- Reverted r22410,r22411,r22428. The compiler will use the unixcp unit to get a default code page for ansistrings.

git-svn-id: trunk@23670 -
2013-02-28 18:21:28 +00:00
yury
d26f0552a0 * Sync with trunk r23404.
* Regenerated makefiles.

git-svn-id: branches/targetandroid@23405 -
2013-01-16 13:21:51 +00:00
yury
7322164c0a * I've found that libc on Android does not implement widechar case functions such as towupper(). Such functions are just wrappers over regular char functions. Therefore the whole cwstring unit is useless for Android. For now I've added stub cwstring unit for Android and reverted all Android specific changes in unix/cwstring.pp. Later, Unicode manager for Androud should be implemented using libicuuc, which is default Android lib.
git-svn-id: branches/targetandroid@23301 -
2013-01-02 18:47:09 +00:00
yury
b480479b8c * Android does not have libiconv, so don't use it in cwstring unit. For now support only UTF-8 code page in ansistrings. Later it is possible to use libicuuc for code page conversions on Android.
git-svn-id: branches/targetandroid@23299 -
2013-01-02 17:38:08 +00:00
svenbarth
764f36a179 Extend TThread with (class) methods and (class) properties from Delphi 2007 and newer.
Especially for the introduction of the Queue method the internal Synchronize handling was modified. Instead of handling only one event there is now a queue of events which is walked completely when CheckSynchronize is called. Each entry in the queue can carry a PRTLEvent which will be signaled when the contained method has been executed and thus Synchronize methods can still be blocking.
Exceptions inside the queued methods are either handed back to the calling method for Synchronize events or raised directly (after leaving the queue in a valid state) to the caller of CheckSynchronize.

The way platform specific adjustments can be made to TThread was changed. Instead of implementing the Constructor and Destructor directly one now implements the methods SysCreate and SysDestroy which are called from the Constructor and Destructor respectively. All RTLs were adjusted for this and should be controlled by the platform maintainers for correct compilation (Unix works).

The new method NameThreadForDebugging has two overloaded variants: one with the thread name as AnsiString and one with the thread name as UnicodeString.
By default the AnsiString variant calls the UnicodeString variant and the latter needs to be implemented. This can be changed by defining THREADNAME_IS_ANSISTRING for a platform. Then the UnicodeString variant calls the AnsiString one and the AnsiString one needs to be implemented.

Also added was a global property CPUCount for the System unit. This property returns the number of virtual cores of the system.

New methods and functions that should be implemented per platform are:
System.GetCPUCount (default returns 1)
Classes.TThread.GetSystemTimes (default zeros the struct)
Classes.TThread.NameThreadForDebugging (default does nothing)

More detailed information about the added methods will be available in the feature announcement mail.

git-svn-id: trunk@23227 -
2012-12-27 16:16:17 +00:00
svenbarth
e914ec7f00 Add platform independant support for "GetTickCount" and "GetTickCount64" to unit "SysUtils". "GetTickCount" is declared as deprecated from the beginning and thus "GetTickCount64" should be used instead.
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 -
2012-12-23 16:12:57 +00:00
sergei
1415569ecb - Removed UnixToWinAge, since revision 444 it does not change its argument, but wastes a lot of CPU cycles converting it from local time and back.
git-svn-id: trunk@23145 -
2012-12-15 08:38:41 +00:00
Jonas Maebe
d3d0df6e4d * terminate with an error when initializing a critical section and recursive
mutexes are not available, since one of the expected properties of
    (Delphi/Windows-compatible) critical sections is that they ar
    re-entrant (mantis #23334)

git-svn-id: trunk@23011 -
2012-11-18 10:23:44 +00:00
Jonas Maebe
676db6d377 * removed stray try/finally statement (mantis #23333)
git-svn-id: trunk@23010 -
2012-11-18 10:23:38 +00:00
Jonas Maebe
8bf71af3b1 * fixed compatilation on Haiku Alpha4 (patch by Olivier Coursière,
mantis #23300)

git-svn-id: trunk@22969 -
2012-11-10 20:26:46 +00:00
Jonas Maebe
a3c936fe5f + rawbytestring/unicodestring overloads for FileCreate and FileOpen.
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 -
2012-09-27 07:54:25 +00:00
Jonas Maebe
598d2feeb6 + rtldefs.inc file for every target that contains defines shared by multiple
RTL units. Comes with a FPCRTL_FILESYSTEM_UTF8 define that can be
    activated for targets whose single byte filesystem interface enforces
    UTF-8; included in inc/systemh.inc and unix/cwstring.pp until now
  + DefaultFileSystemCodePage variable that holds the code page used for
    communicating with the OS single byte file system APIs, and for the
    strings returned by those same APIs. Initialized with
   o the result of GetACP in the system unit of Windows platforms, except for
     WinCE which uses UTF-8 since its file system OS API calls already use
     the UTF-16 versions
   o CP_UTF8 on Unix platforms with FPCRTL_FILESYSTEM_UTF8 defined, and with
     DefaultSystemCodePage on other Unix platforms
   o DefaultSystemCodePage on Java/Android JVM targets
  + DefaultRTLFileSystemCodePage variable that holds the code page used to
    encode strings returned by RTL routines that return filenames obtained
    from OS API calls. By default the same as DefaultFileSystemCodePage on
    all platforms. Separate from DefaultFileSystemCodePage for clarity on
    platforms that may use either utf-16 or single byte OS API calls to
    send/receive file names (such as most Windows platforms)
  + new scpFileSystemSingleByte enum that can be passed to
    GetStandardCodePage() to get the default code page for OS single byte file
    system APIs, with implementations for Unix and Windows
  + SetMultiByteFileSystemCodePage() procedure to override the value of
    DefaultFileSystemCodePage

  In principle, in the long run unchanged programs only using generic
  ansistrings and unicodestrings should (mostly) behave the same as in
  FPC 2.6.0 as far as RTL-level file system APIs are concerned if
  they set DefaultFileSystemCodePage and DefaultRTLFileSystemCodePage
  to DefaultSystemCodePage at the start of their execution

git-svn-id: branches/cpstrrtl@22466 -
2012-09-27 07:54:06 +00:00
paul
a2548fc9f9 rtl: pass exact size to delete instead of full string length
git-svn-id: trunk@22418 -
2012-09-18 00:31:21 +00:00
paul
d7d8c10aaf bsd: set DefaultSystemCodePage without cwstring.pas
git-svn-id: trunk@22410 -
2012-09-17 02:33:06 +00:00
marco
1a895a875b * move fpgetenv(pchar) to unit system for syscall based *nix rtls.
It was already available for libc based *nix rtls

git-svn-id: trunk@22365 -
2012-09-10 09:21:56 +00:00
marco
e245802fa8 * deprecated old shortstring getenv func.
git-svn-id: trunk@22364 -
2012-09-10 09:01:24 +00:00
Jonas Maebe
d4eb2d7336 * fixed the conversion of 'UTF-8' to the corresponding code page number
(there's a dummy entry with code page 0 for UTF-8 in the table for
     when 0 is searched, but when going from string to number that
     entry has to be skipped so the real UTF-8 entry is used)

git-svn-id: trunk@22245 -
2012-08-26 08:58:42 +00:00
pierre
4ecd67f6e2 * Use gsed if present and temp directory to avoid system recompilation
git-svn-id: trunk@22169 -
2012-08-22 09:43:34 +00:00
marco
b822371d41 * add platform modifiers to all locally defined functions in unix' dos unit.
git-svn-id: trunk@22069 -
2012-08-13 10:14:07 +00:00
tom_at_work
810adb2f65 Merge with trunk r22040. Regenerated makefiles.
git-svn-id: branches/targetandroid@22046 -
2012-08-09 08:12:34 +00:00
Jonas Maebe
6cc78635d7 * send full x/y ansi position information in case of an X-coordinate
overflow (don't know what the y-coordinate is at that point, because the
    window may be  wider than the artificial screenwidth) (mantis #20880)

git-svn-id: trunk@21925 -
2012-07-17 18:03:23 +00:00
pierre
68c8383254 Add support for binary/octal/hexadecimal constants
git-svn-id: trunk@21901 -
2012-07-12 13:09:32 +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
michael
64ab9c06d3 * Added GetLocalTimeOffset function
git-svn-id: trunk@21865 -
2012-07-11 09:56:34 +00:00
pierre
9bba5c956a Add support for indirect values
git-svn-id: trunk@21830 -
2012-07-09 13:46:11 +00:00
pierre
2d6093645f Add a C compilation phase to check Error value
git-svn-id: trunk@21826 -
2012-07-09 13:14:37 +00:00
pierre
b93b08427f Set needgsed to 0 for non-NetBSD systems
git-svn-id: trunk@21823 -
2012-07-09 09:56:45 +00:00
tom_at_work
4150f0a2fb Rebase with r21814
git-svn-id: branches/targetandroid@21815 -
2012-07-07 23:09:20 +00:00
sergei
185e34915c - Removed level 2 comments and control characters in comments.
git-svn-id: trunk@21726 -
2012-06-27 20:04:39 +00:00
pierre
cd0522189c Try to improve system error check script
git-svn-id: trunk@21633 -
2012-06-17 14:47:26 +00:00
marco
0757517dde * more removal of deprecated functions (deprecated before 2.4.0)
old copies of routines in dos, and some shortstring shorthands for fsplit.

git-svn-id: trunk@21359 -
2012-05-22 08:04:24 +00:00
marco
043ff2c81c * more deprecations. Copies of stringtypes usually defined in unit dos, but
that are no longer needed.

git-svn-id: trunk@21358 -
2012-05-22 08:00:36 +00:00
marco
725a280059 * sleeper vfork code copied from deleted parts so it is not lost, made
shortstring version call the ansistring one.

git-svn-id: trunk@21336 -
2012-05-19 14:03:20 +00:00
marco
455d675c5a * removed an empty overloaded version of statfs that could be called recursively
and its use in sysutils. Fixes failure of tw1041 and tw9985 in last runs.

git-svn-id: trunk@21334 -
2012-05-19 12:09:39 +00:00
marco
1a73c652ca * improve deprecation message.
git-svn-id: trunk@21333 -
2012-05-19 11:58:59 +00:00
marco
0ddd03eef2 * removed some deprecated functions (deprecated since 2.2.0/2007 times)
* added some new minor deprecations (mostly unused constants that are 
   potentially not crossplatform, and an shortstring version of a function)

git-svn-id: trunk@21321 -
2012-05-18 12:11:06 +00:00
marco
6c0ba4af0c * getfs deprecated, replaced by a totally crossplatform sysutils.getfilehandle, probably already since 2.4.0
git-svn-id: trunk@21317 -
2012-05-17 16:58:09 +00:00
tom_at_work
77a85b7448 * basic android/x86 support
git-svn-id: branches/targetandroid@21296 -
2012-05-14 21:14:12 +00:00
tom_at_work
bf2a01cfeb fix pthreads use with Android: it does not provide some functions. This patch is partially based on the bug report 0021525. Further, fix use of sem_timedwait in cthreads.pp since Android supports it.
git-svn-id: branches/targetandroid@21066 -
2012-04-26 19:05:06 +00:00
tom_at_work
a7b48be598 bugfixes:
- do not compile ipc unit for android, not supported
- fix geterrnolocation external name
- implement dummy getdomainname; does not exist in android
- remove wrong 'if defined(android)' clauses

git-svn-id: branches/targetandroid@21065 -
2012-04-26 13:15:52 +00:00
tom_at_work
acbc94e0fd - initial support for the android/arm target in the compiler; resulting .so's can be used for Android/ARM app development.
- basic rtl support using system calls
- fp(c)make/fppkg/makefile support

todo:
- revisit systems/t_android.pas: mostly duplicate with t_linux.pas, containing
lots of unnecessary code
- revisit rtl changes
- android ndk header translation import
- better app build/packaging support
- android/x86 support

git-svn-id: branches/targetandroid@21061 -
2012-04-26 09:36:42 +00:00
pierre
cea6ca2df9 Fix FpSigProcMask overload for OpenBSD: Warning this probably breaks compilation of unix's RTL by obsolete 2.4.4 release compiler, 2.6.0 required
git-svn-id: trunk@21005 -
2012-04-23 10:12:43 +00:00
pierre
8c047abb43 + New script to check constant entries against system headers
git-svn-id: trunk@20934 -
2012-04-19 14:56:32 +00:00
pierre
3f24548e58 + New script to check errnostr.inc entries
git-svn-id: trunk@20933 -
2012-04-19 14:55:57 +00:00
pierre
0309511353 Add clean option, do not create executable (unneeded)
git-svn-id: trunk@20932 -
2012-04-19 14:52:47 +00:00
pierre
9106753b8a Improve check_sys.sh script
git-svn-id: trunk@20926 -
2012-04-19 07:18:13 +00:00
pierre
1592f98a69 Avoid inappropriate file name expansion
git-svn-id: trunk@20921 -
2012-04-18 15:43:47 +00:00
pierre
6568de7e0f Avoid \t which is not supported properly on NetBSD and accept negative values
git-svn-id: trunk@20918 -
2012-04-18 10:50:16 +00:00
pierre
c4288ea2c0 * Fix missing echo command
git-svn-id: trunk@20916 -
2012-04-18 10:35:47 +00:00
pierre
eb90a60afe New test for sysnr.inc system error numbers
git-svn-id: trunk@20914 -
2012-04-18 10:31:29 +00:00
pierre
90f12d0e4d Improve check for Linux
git-svn-id: trunk@20913 -
2012-04-18 10:30:19 +00:00
pierre
b3f3e0d2a1 Move check_sys.sh to unix/scripts directory
git-svn-id: trunk@20911 -
2012-04-18 10:24:34 +00:00
pierre
11fe796ac3 Add script directory
git-svn-id: trunk@20910 -
2012-04-18 10:10:03 +00:00
pierre
7d82ed4459 + Add ACCEPT_646 for systems that return '646' for nl_langinfo(CODESET) call
git-svn-id: trunk@20905 -
2012-04-17 15:28:28 +00:00
Tomas Hajny
d442d14e0c + FileNameCasePreserving added - see #18066 in Mantis
git-svn-id: trunk@20894 -
2012-04-15 20:56:13 +00:00
Jonas Maebe
f0b7ce8afe * fix building for Haiku/BeOS after r20839 (patch by Olivier Coursière)
git-svn-id: trunk@20878 -
2012-04-14 20:36:02 +00:00
Jonas Maebe
1e9b92ee50 + AIX support for cwstring
o AIX-specific codepage names
   o AIX/ppc32 uses a 16 bit wchar_t
   o special support for handling cp866 on AIX: AIX only supports converting
     cp866 from/to ISO8859-5 -> always use that code page as an intermediate
     one on AIX (it's lossy, but better than completely failing)
  * in case the default system code page cannot be detected, fall back to
    UTF-8

git-svn-id: trunk@20839 -
2012-04-11 18:06:22 +00:00
Jonas Maebe
2c1f98320f * disable implicit exception frames, no exceptions are raised by this unit
git-svn-id: trunk@20838 -
2012-04-11 18:06:18 +00:00
Jonas Maebe
d545a72f1a + lnfogdb unit that can use gdb to symbolicate backtraces on unix targets
(used for stabx/aix)

git-svn-id: trunk@20833 -
2012-04-11 18:05:56 +00:00
Jonas Maebe
9a1cd0ec4c * fixed checking the address of installed signal handlers on aix and
linux/ppc64 (have to look past the function descriptors)

git-svn-id: trunk@20820 -
2012-04-11 18:04:50 +00:00
Jonas Maebe
7c0469e1fd * link libbsd for AIX, because several UNIX routines are part of its BSD
Compatibility library

git-svn-id: trunk@20788 -
2012-04-11 18:00:08 +00:00
Jonas Maebe
8d8fc0fdee + RTL for AIX
git-svn-id: trunk@20786 -
2012-04-11 17:59:49 +00:00
pierre
ae83b5ce92 Return -1 for fpIOPL and set errno to ESysENoSys for non-linux systems
git-svn-id: trunk@20773 -
2012-04-09 21:55:18 +00:00
pierre
55665c6713 Set local variable s to empty string at entry of transform_cp437_to_UTF8 function
git-svn-id: trunk@20772 -
2012-04-09 21:54:19 +00:00
Jonas Maebe
d3004d2bf6 * use same defaults for iPhoneSimulator as for iOS (UTF-8 etc, newer
iPhoneSimulator platforms no longer inherit the Mac OS X settings)

git-svn-id: trunk@20653 -
2012-03-29 17:13:29 +00:00
pierre
ff5d25174a * Fix wide string shared library loading by adding 'lib' prefix if needed
git-svn-id: trunk@20568 -
2012-03-22 09:02:07 +00:00
Jonas Maebe
cc736fe115 * use same code path for iphonesim as for darwin (should fix mantis #21190)
git-svn-id: trunk@20374 -
2012-02-17 20:28:43 +00:00
pierre
ea9f152d64 * Remove local redefinition of types and clarify TIPC_Perm record
git-svn-id: trunk@20354 -
2012-02-15 13:18:30 +00:00
pierre
24d100d164 NetBSD CODESET and LC_ALL added
git-svn-id: trunk@20337 -
2012-02-13 16:43:45 +00:00
pierre
b4f024362b NetBSD code added
git-svn-id: trunk@20336 -
2012-02-13 16:43:16 +00:00
sergei
e94508d5eb * Improved utf16 to ucs4 conversion routines: removed function call on every character, allocate memory once and made as much as possible code shared between WideString and UnicodeString versions.
git-svn-id: trunk@20269 -
2012-02-06 17:55:06 +00:00
sergei
c862aec17c * cwstring.pp, Wide2AnsiMove: moved SetCodePage to the end, so it comes after the last SetLength. Necessary after r20209, because SetLength has been modified to always set the code page of its argument. Here it sets code page of 'dest' to CP_NONE, because dest is RawByteString.
(Before r20209, SetLength was preserving code page when the string was resized in place and had refcount=1)

git-svn-id: trunk@20214 -
2012-02-01 21:08:13 +00:00
marco
a0b200db76 * Add dlvsym under ifdef ELF, defined ELF for the OSes I could check
(FreeBSD, OpenBSD, Linux) Mantis #18892

git-svn-id: trunk@20134 -
2012-01-21 11:56:40 +00:00
Jonas Maebe
eb680bcc5b * don't try to set the iconv transliterate property in case the iconv
encoder was not successfully initialised

git-svn-id: trunk@19965 -
2012-01-04 16:08:15 +00:00
Jonas Maebe
f287cf3f61 * default to UTF-8 as system code page in case nl_langinfo(CODESET) returns
an empty string

git-svn-id: trunk@19964 -
2012-01-04 16:06:27 +00:00
michael
2625b1dfa4 * Improved efficiency of Now/Date/Time
git-svn-id: trunk@19572 -
2011-11-02 14:33:33 +00:00
michael
86c0b324fd * Added ReReadTimeZone
git-svn-id: trunk@19569 -
2011-11-01 18:05:38 +00:00
paul
b7185a554c rtl:
- replace ifndef ver2_4 with ifdef FPC_HAS_CPSTRING for places with TextRec.CodePage access
  - convert codepages for Read and Write text file operations

git-svn-id: trunk@19545 -
2011-10-25 08:40:49 +00:00
paul
e08c68f308 rtl: set codepages for TextRec field when Text file is opened + update this field for standard IO files when cwstring is used
git-svn-id: trunk@19543 -
2011-10-25 06:27:54 +00:00
paul
270fb09e87 rtl: add WideStringManager.GetStandardCodePageProc method to retrieve system ansi and console code pages
git-svn-id: trunk@19539 -
2011-10-25 01:39:11 +00:00
paul
3e29f0b179 rtl: make cwstring.pp dependent of dynlibs, load iconvctl dynamically
git-svn-id: trunk@19538 -
2011-10-25 01:25:23 +00:00
Jonas Maebe
9ee27c1606 * support for iOS-specific location of "localtime" time zone file
(problem reported at http://blogs.embarcadero.com/ao/2011/10/20/39180 )

git-svn-id: trunk@19537 -
2011-10-24 19:24:57 +00:00
Jonas Maebe
01b980a462 * added "inc" extension to {$i winiconv}
git-svn-id: trunk@19529 -
2011-10-22 08:59:07 +00:00
Jonas Maebe
2b63a7d66f * fixed compilation on darwin/arm after r19522
* replaced defined(arm) with defined(cpuarm) checks (cleaner)

git-svn-id: trunk@19528 -
2011-10-22 08:40:37 +00:00
paul
5d7d143300 rtl: transliterate characters if possible intead of replacing them with "?" chars while converting between codepages
git-svn-id: trunk@19522 -
2011-10-21 03:23:23 +00:00
pierre
ad40c306cd * Use recent libc __errno function for OpenBSD
git-svn-id: trunk@19447 -
2011-10-10 21:33:58 +00:00
pierre
dbd3df9ddf + Added OpenBSD CODESET and LC_ALL values
git-svn-id: trunk@19369 -
2011-10-04 22:20:41 +00:00
pierre
7f69e6426d * Try to update i386/openbsd port
git-svn-id: trunk@19350 -
2011-10-03 23:22:28 +00:00
paul
6384fa2a19 rtl: revert r19330. We probably need to create a separate encoding<->codepage table.
git-svn-id: trunk@19332 -
2011-10-03 10:28:14 +00:00
paul
a0e7196ae9 rtl: move winiconv.inc into general inc directory and rename it to wincodepages.inc, also rename win2iconv, iconv2win to CodePageToCodePageName, CodePageNameToCodePage.
This change is required since CodePage to CodePage name conversions are required in other parts of RTL. Moreover those codepage identifiers are windows codepage identifiers and thus must be compatible with codepage identifiers used by delphi.

git-svn-id: trunk@19330 -
2011-10-03 03:35:45 +00:00
Jonas Maebe
591230104b * prevent the internal windows code page number -> iconv name and vice versa
conversion routines from resulting in any code page conversions themselves

git-svn-id: trunk@19320 -
2011-10-01 23:26:12 +00:00
Jonas Maebe
258869c8f1 * and one more fix to prevent endless loops
git-svn-id: trunk@19196 -
2011-09-23 19:16:48 +00:00
Jonas Maebe
3469942f34 * fixed potential endless loop if the code page passed to win2iconv()
is not found

git-svn-id: trunk@19195 -
2011-09-23 18:34:31 +00:00
Jonas Maebe
7dd5811828 + support for transcoding the new ansistring type on unix platforms
* initialize DefaultSystemCodePage on unix platforms

git-svn-id: trunk@19194 -
2011-09-23 17:32:18 +00:00
marco
07fabab526 * fpgetsid, Mantis #20329
git-svn-id: trunk@19178 -
2011-09-22 13:21:38 +00:00
michael
1579470a68 * Also check TMPDIR, a UNIX standard used by a.o. iOS (mantis #20248)
git-svn-id: trunk@19175 -
2011-09-22 11:29:50 +00:00
paul
528f7fbb06 rtl: manual merge some cpstrnew changes which was impossible to merge using regular tools due to the merge conflicts
git-svn-id: trunk@19137 -
2011-09-18 01:40:56 +00:00
paul
091627883f merge r14347 from cpstrnew branch by florian:
* fixed bootstrapping with 2.4.0
* patches by Graeme Geldenhuys, resolve #15251, #15252, #15253

git-svn-id: trunk@19102 -
2011-09-17 12:00:06 +00:00
florian
c32bc3a22a * patch by Nikolay Nikolov to support Alt-Tab and Ctrl-Tab on the linux console, resolves #19247
git-svn-id: trunk@18225 -
2011-08-16 18:58:50 +00:00
marco
7eeb4ab539 * also return fasymbolic if dir is found.
* update getattr to also return fasymbolic
  Patch by Dimitri B. Mantis #16817	

git-svn-id: trunk@18043 -
2011-08-01 11:36:28 +00:00
marco
2c00a2a0b3 * fixed FPC_USE_LIBC building for Linux and exception handling (mantis #13450)
- fixed a platform modifier in ipc.pp
   - fixed different layout sigaction record in libc. (field order)
   - fixed many bad use_libc fixes in linux. Most of these were only checked
      for compilation, not linking. (e.g. futex doesn't link)

git-svn-id: trunk@18042 -
2011-07-31 23:36:17 +00:00
michael
e357dc3fb9 * LongdateFormat equals shortdateformat (no longdateformat is available in langinfo) Bug #19616.
git-svn-id: trunk@17914 -
2011-07-02 13:42:44 +00:00
michael
a201f07420 * Added share mode argument to FileCreate call
git-svn-id: trunk@17548 -
2011-05-23 21:11:07 +00:00
florian
16b47d4e07 * patch by Nikolay Nikolov to use a hardware block cursor on the
linux console, resolves #19259

git-svn-id: trunk@17516 -
2011-05-20 20:39:43 +00:00
michael
be484359b8 * Corrected fix for FileAge
git-svn-id: trunk@17224 -
2011-04-02 15:28:24 +00:00
michael
9747f7f0cd * Do not allow fileage for directories (15873)
git-svn-id: trunk@17221 -
2011-04-02 10:43:39 +00:00
sergei
d3fe020a55 * Don't use deprecated symbols anymore, silences compilation.
* GetFormatSettings function now can fill an arbitrary TFormatSettings record.

git-svn-id: trunk@17209 -
2011-03-30 16:20:56 +00:00
marco
d9773a2ee0 * added alias for statsfs
git-svn-id: trunk@17037 -
2011-02-27 20:14:11 +00:00
marco
608498c64c * committed the fpc/ hierarchy parts of the patch in mants 18271:
Adding clocale to Solaris.

git-svn-id: trunk@16771 -
2011-01-16 10:37:02 +00:00
Jonas Maebe
a2e8134b7c * part of r16533, forgot to commit
* also fixes CharLengthPChar() for non-BeOS by initialising the mbstate
    parameter passed to mbrlen() to 0 (otherwise its contents are interpreted
    as already valid, containing information about the current shiftstate etc)

git-svn-id: trunk@16552 -
2010-12-11 18:08:16 +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
Jonas Maebe
0cb2fa1baf + semtimedop() for Linux, marked as "platform" (last part of patch from
mantis #14075)

git-svn-id: trunk@16339 -
2010-11-13 18:37:43 +00:00
Jonas Maebe
36aa39cc38 o fixed several Linux ipc bugs, based on patch by Ruben Chaer/
Pablo Alfaro (mantis #14075, also fixes #13363):
    * ipc msgtyp is clong, not cint
    * TIPC_Perm and TSEMid_ds are different on 64 bit systems
    * fixed passing semun arguments (have to be passed by value, not reference)
    * fixed the order of parameters to msg* syscalls, and don't use
      TIPC_Kludge for msgrcv syscall (only for ipccall.inc variants)
    * use new operation variants on 64 bit platforms in ipccall.inc
  * introduced use kernel_mode/uid/gid_t types for use by the Linux ipc
    records
  * fixed type of TSEMid_ds.sem_base for Darwin
  * added {$packrecords c} to ipc unit, and {$packrecords 4} around
    certain structs for Darwin as in the C headers
  * fixed passing semun argument to semctl for libc platforms (by
    value, not reference)

git-svn-id: trunk@16336 -
2010-11-13 16:58:23 +00:00
Jonas Maebe
c4488f6b3a * hook up CompareUnicodeStringProc and CompareTextUnicodeStringProc in
cwstring (fixes webtbs/tw17591.pp on unix platforms)
  * enhanced webtbs/tw17591.pp so it also (superficially) checks the
    correctness of the called routines, and add cwstring for unix platforms

git-svn-id: trunk@16298 -
2010-11-03 12:16:20 +00:00
michael
8dd254b281 * Fixed synchronize/waitfor issue
git-svn-id: trunk@16145 -
2010-10-12 18:08:24 +00:00
mazen
b127fc154a * Fixed spell error revealed by lintian.
git-svn-id: trunk@16094 -
2010-10-06 20:33:57 +00:00
Jonas Maebe
1258fd6ef0 - disabled FpSigTimedWait also for haiku (based on patch by
Olivier Coursiere, mantis #16996)

git-svn-id: trunk@15620 -
2010-07-20 20:54:04 +00:00
Jonas Maebe
62ece31615 - disabled fpsigtimedwait for darwin because it doesn't exist there
git-svn-id: trunk@15605 -
2010-07-18 22:07:33 +00:00
daniel
1009a84e25 + Add modify_ldt to linux unit
+ Add sched_yield to linux unit
  - Remove clone for m68k from linux unit (unimplemented assembler section)
  + Add fpsigtimedwait to baseunix unit

git-svn-id: trunk@15602 -
2010-07-18 21:53:26 +00:00
Jonas Maebe
d7cdd9afba * allow tthread-based threads to only start executing once the constructor
has finished running (based on patch by Jared Davison, mantis #16884)

git-svn-id: trunk@15599 -
2010-07-18 16:31:25 +00:00
Jonas Maebe
bfc1a6ff1c + added support for intialising/finalising threads not started via the FPC
runtime

git-svn-id: trunk@15557 -
2010-07-12 16:16:50 +00:00
Tomas Hajny
03f52902f3 * do not use / as DriveSeparator
git-svn-id: trunk@15454 -
2010-06-19 16:22:10 +00:00
Jonas Maebe
194855eee0 * de-tabbed
git-svn-id: trunk@15419 -
2010-06-13 11:44:33 +00:00
Jonas Maebe
45c813929a * update the coordinates properly if a string is written that exactly fills
a line (mantis #15599)

git-svn-id: trunk@15241 -
2010-05-08 11:29:25 +00:00
marco
02069109d1 * haiku also sinlen, Mantis 16176
git-svn-id: trunk@15104 -
2010-04-01 11:38:55 +00:00
marco
8cce3d3f91 * closethread thread manager field/function. Mantis 13160
git-svn-id: trunk@15072 -
2010-03-26 23:31:52 +00:00
Jonas Maebe
4d8f578e4c * when typecasting the result of pthread_self, always call it using
pthread_self(), because it's a procvar under Linux and hence otherwise
    the value of the procvar instead of the function result will be
    taken (mantis #15821)

git-svn-id: trunk@15049 -
2010-03-24 21:51:07 +00:00
marco
c477df5046 * TCriticalSection.Tryenter support (Mantis 15928) + short test/demo
tested on FreeBSD (general Unix) and Windows. Note that Haiku seems 
    to have a native threadmgr rather than the Unix one. Will notify 
    maintainer (Olivier)

git-svn-id: trunk@15026 -
2010-03-21 11:34:05 +00:00
Jonas Maebe
3ea3a41d2a o patch from Olivier for Haiku libiconv functionality (mantis #15906):
* Haiku's nl_langinfo implementation is now used under Haiku instead of
      the BeOS stub.
    * Fix linking to iconv in the iconvenc package. The prefix has change
      since the previous Haiku's version.

git-svn-id: trunk@14995 -
2010-03-09 09:58:14 +00:00
Jonas Maebe
9cd0a2ff1e * link to libpthread at compile time on Linux to avoid problems on some
newer glibc systems when it's only loaded dynamically at run time

git-svn-id: trunk@14970 -
2010-03-04 15:36:35 +00:00
marco
be98b13554 * fix for 11263, changed fileread and fd_zero to out using $modeswitch.
git-svn-id: trunk@14965 -
2010-03-01 22:35:14 +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
pierre
048b2ba67b * fix pthread problem wen using nice for solaris
git-svn-id: trunk@14823 -
2010-01-28 19:05:42 +00:00
pierre
df33542ca9 + Timezone support for solaris
git-svn-id: trunk@14821 -
2010-01-28 11:03:32 +00:00
marco
b8d5a8f44c * Linux specific time_t fixes. Also tested with -dFPC_USE_LIBC and more problem fixed.
git-svn-id: trunk@14586 -
2010-01-09 22:02:36 +00:00
marco
5d87461507 * moves the alias "TTime = time_t" from ptypes.inc to unixtype.pp.
This means it is not aliased in the body of the system unit (which causes
  trouble with the delphi type of the same name), but baseunix/unix/unixtype
  will containue to export the type.

git-svn-id: trunk@14584 -
2010-01-09 16:05:42 +00:00
marco
8e9a7e14ad * Revised yesterday solution to a more general one. Executeprocess gets
another parameter, a set type with flags, default = []

git-svn-id: trunk@14572 -
2010-01-07 20:49:28 +00:00
Jonas Maebe
b214448b9e * don't access the thread instance after calling DoTerminate to avoid
race conditions in case DoTerminate can cause the thread to be freed
    already. Side-effect: changing FreeOnTerminate in DoTerminate no longer
    has any effects, but this is compatible with the generic code for
    ThreadProc in objpas/classes/classes.inc (patch by Nikolai ZHUBR)

git-svn-id: trunk@14504 -
2009-12-30 14:46:56 +00:00
florian
a3884c4e49 * fixes bootstrapping with 2.2.x
git-svn-id: trunk@14355 -
2009-12-07 20:16:31 +00:00
pierre
90ddd046bc * Use default functions if call to iconv_open failed
git-svn-id: trunk@14352 -
2009-12-07 16:57:12 +00:00
Jonas Maebe
722d48c8c2 * only return an error if locking a file fails when the file is already
locked, but not when another error occurs (such as EsysNOLCK, because
    this error may always be returned if the kernel doesn't support
    locking, in which case programs such as fpcmake no longer work on
    such systems)

git-svn-id: trunk@14350 -
2009-12-07 13:30:19 +00:00
michael
01ed4a6745 * Implemented OnBeep to install custom beep handler
git-svn-id: trunk@14254 -
2009-11-22 17:33:56 +00:00
marco
17062d667c * ansistring versions of mk/rm/chdir in objpas, Mantis 15010. The os-dependant routines of *nix/os2/win/dos have been converted
git-svn-id: trunk@14211 -
2009-11-18 18:04:51 +00:00
Jonas Maebe
c2190ebd30 * return errors from unimplemented functions instead of random values
git-svn-id: trunk@14002 -
2009-11-01 15:41:29 +00:00
marco
778505701c * set/getrlimit now also visible in baseunix when syscalls are used.
on systems that force ugetrlimit, use that transparently. (since 
    ugetrlimit is not posix in theory or practice, we can't export it),
    resolves 13916

git-svn-id: trunk@13903 -
2009-10-17 19:14:09 +00:00
marco
5121f470a2 * moved ugetrlimit to the implementation (as linux specific call it shouldn't be exported)
* syscall implementation for FreeBSD of get/setrlimit

git-svn-id: trunk@13875 -
2009-10-16 18:47:43 +00:00
olivier
2e8a93da16 * tune new variable TerminalSupportsBold and TerminalSupportsHighIntensityColors
for BeOS and Haiku.
  * BeOS : the terminal is very limited. Disabling both give best result.
  * Haiku : Haiku's terminal claims to be xterm but has it's own problems.

git-svn-id: trunk@13741 -
2009-09-19 16:10:36 +00:00
florian
07ef0c33df o another linux console patch by Nikolay Nikolov:
* disabled linux VCSA output in UTF-8 mode, because it does not do any translation 
  and assumes that the font is cp437, or similar, which looks horrible on fonts 
  (like fedora's default latarcyrheb-sun16), which are designed only for unicode 
  support and have no similarity at all to cp437. We already can display all the 
  cp437 characters in UTF-8 mode (including the low 32 characters), in case the 
  font is cp437, and the UTF-8 translation provides better approximation (e.g. 
  for the line drawing characters) if the font is not cp437.
* do not "restore" the linux system font in SysDoneVideo in UTF-8 mode, 
  since we didn't change the font on startup
* added try_grab_vcsa to try harder to open VCSA in the linux IDE user 
  screen restore code. While VCSA is no longer needed in the video unit on 
  UTF-8 systems, the IDE still needs it, because it's the only way to provide 
  the "restore user screen" functionality on the linux virtual console.

git-svn-id: trunk@13726 -
2009-09-16 19:58:42 +00:00
Jonas Maebe
1f6b55290e * fixed fpsignal for linux/x86_64 and possibly some other platforms as well
(patch by Nikolay Nikolov, mantis #14514)

git-svn-id: trunk@13666 -
2009-09-06 20:03:09 +00:00
florian
a023c165da o patch by Nikolay Nikolov to make the text mode IDE look pretty under
modern Linuxes by a patch for UTF-8 console output. 
  Previously, only BeOS used UTF-8. Tested with:
   - the linux console
   - xterm
   - gnome-terminal
   - konsole
   - rxvt-unicode
  using Fedora 11.
  Tested with
   - gnome-terminal
   - xterm
   - konsole
  using Ubuntu 9.04
Known "features": 
  * high intensity colours were actually normal intensity, with a bold attribute set. 
    This worked fine under gnome-terminal, but xterm didn't have bold versions of all cp437 characters, 
    which screwed up the window borders in the IDE. And although konsole had them, I didn't like the font - 
    it converted all the double window borders to a very thick single-line border. 
    So I disabled the bolding of high intensity colours in all X11 terminals (TERM=xterm) 
    and replaced it with another ANSI attribute, that actually sets high intensity 
    colours, but is not (in theory) supported by all terminals. The linux console doesn't 
    support it - it actually wants a bold attribute, to set high intensity, 
    so that's why I enabled it only for X11 terminals. All the ones, 
    that I tried, worked fine (xterm, gnome-terminal, 
    konsole, rxvt-unicode, also the plain old rxvt, with a non-UTF-8 locale).
  * Fedora 11 by default uses a 512-characters font, called latarcyrheb-sun16 
    for the linux text mode console, which disables the high intensity colours, 
    effectively reducing the set of available colours to only 8. 
    This is a hardware limitation of the VGA hardware and can be avoided by 
    using a 256-character font. It does not need to be cp437, 
    but it has to have an unicode mapping.
  * I haven't tried other linux distros (and unix-like OSes, i.e. FreeBSD and Mac OS X) - 
    although they should work in theory, they might look bad, due to different fonts, etc. 

git-svn-id: trunk@13651 -
2009-09-05 14:54:22 +00:00
olivier
7616e9e50e * Harmonize kbAltUp, kbAltDown and kbAltRight declarations for xterm
terminals with kbAltLeft. Only applied to Haiku to stay on the safe side. 
  Fix use of up, down and right arrow keys in fpide under Haiku 
  (mantis #14491) 

git-svn-id: trunk@13644 -
2009-09-04 21:29:25 +00:00
michael
e8a375c774 * Patch from Henry Vermaak to fix EABI kernel API for arm.
git-svn-id: trunk@13563 -
2009-08-20 08:00:50 +00:00
Jonas Maebe
ef1c033f49 + added fppause() for FPC_USE_LIBC
* fixed test

git-svn-id: trunk@13436 -
2009-07-24 21:52:01 +00:00
marco
7c52be9287 * moved a linux specific call to the implementation of system, where
it is used. General Unix units should not expose Linux-specific 
   functionality.

git-svn-id: trunk@13427 -
2009-07-23 11:35:18 +00:00
Jonas Maebe
deb052c3f5 * skip glibc-specific modifiers while parsing the locale info
(patch by Petr-K, fixes mantis #12148)

git-svn-id: trunk@13396 -
2009-07-16 16:51:10 +00:00
Jonas Maebe
4e446c6184 * use ShortTimeFormat also for LongTimeFormat if T_FMT_AMPM is not defined
for the current locale (Kylix-compatible, thanks to Luca Olivetti for
    the hint, fixes mantis #13947)

git-svn-id: trunk@13395 -
2009-07-16 16:44:15 +00:00
Jonas Maebe
25463000ac * do not mark all found files with Find* as "faHidden" if the search path
starts with './' (mantis #14020)
  * also mark files whose name starts with '.' that are found in subdirectories
    as faHidden (not reported, but was due to a similar error)
  - removed some unused variables related to the Find* functionality

git-svn-id: trunk@13307 -
2009-06-21 10:21:06 +00:00
marco
a862d93652 * unix sockets now also exports tsocklen, like windows one
git-svn-id: trunk@13276 -
2009-06-15 08:17:05 +00:00
michael
9538da64f9 * Change so that when FindFirst initially returns nonzero, FindClose is no longer needed (Windows compatible)
git-svn-id: trunk@13209 -
2009-05-29 07:24:02 +00:00
Jonas Maebe
78c29a33ba * changed the parameters of gotoxy() and the return values of wherex/wherey
from byte into tcrtcoord=1..255, since all crt unit coordinates are
    1-based (not for Window() procedure, see comments in crth.inc;
    mantis #13788)

git-svn-id: trunk@13191 -
2009-05-24 11:48:49 +00:00
Jonas Maebe
f6d452c2c0 * remove the RTL's installed signal handlers at the end of the system
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 -
2009-05-02 09:40:44 +00:00
Jonas Maebe
99a02a93ca * also consider the search attributes for findfirst if the name does
not contain wildcards + test
  * don't return true from FindGetFileInfo if the file name is ok, but the
    search attributes don't match (resulted in returning multiple times the
    name of the previous entry that did fulfill all requirements)

git-svn-id: trunk@13074 -
2009-05-01 16:03:56 +00:00
Jonas Maebe
afab9fb99c * force utf-8 on iPhoneOS, because locale settings are absent/ignored there
git-svn-id: trunk@13066 -
2009-05-01 09:19:53 +00:00
Jonas Maebe
4771ca3ce1 * import iconv functions as libiconv_* instead of as iconv_* for ppc32
for Mac OS X 10.3 compatibility

git-svn-id: trunk@13035 -
2009-04-25 09:34:11 +00:00
Jonas Maebe
1ad1eac9e8 * use monetary thousands separator if numerical thousands separator is #0
(mantis #13552, patch by Jesus Reyes)

git-svn-id: trunk@13029 -
2009-04-23 19:17:37 +00:00
Jonas Maebe
039847b5c0 - removed duplicate GenMouseEvent() procedure (patch by Danny Milosavljevic,
mantis #13412)

git-svn-id: trunk@12993 -
2009-04-01 17:12:55 +00:00
Jonas Maebe
c66791a605 * made AddSpecialSequence() public with the "platform" keyword, as
suggested by Marco in his comment to mantis #13413

git-svn-id: trunk@12992 -
2009-04-01 17:05:33 +00:00
Jonas Maebe
fe773871d6 * EINTR handling...
git-svn-id: trunk@12930 -
2009-03-20 13:03:14 +00:00
Jonas Maebe
803e78ff8c * and more ESysEINTR and fpwaitpid fixing
git-svn-id: trunk@12929 -
2009-03-19 22:51:41 +00:00
Jonas Maebe
8b53f8c41a * fixed a bunch of cases where ESysEINTR wasn't handled
git-svn-id: trunk@12924 -
2009-03-19 21:46:12 +00:00