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 -
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 -
* 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 -
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 -
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 -
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 -
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 -
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 -
* 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 -
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 -
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 -
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 -
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 -
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 -
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 -
+ add posix thread support
* improve signal handling
* synchronize haiku's baseunix unit with the unix one (maybe it will be possible to remove Haiku's one in a future patch, but i keep it for now)
+ add support for standard sockets
* fix some functions import to use the right libraries under Haiku
* fix packages compilation
git-svn-id: trunk@12636 -
(locking is based on fcntl there, and that one cannot create an
exclusive lock for a read-only file or a shared lock for a write-only
file)
git-svn-id: trunk@12633 -
* added csize_t = UnixTypes.size_t in ctypes.pp for unix systems.
* reason: size_t is a C type and it's often used by C header files. Several packages define their own size_t.
git-svn-id: trunk@12602 -
- a little more native rtl: it use a native haiku library for select function instead of relying on a compatibility symlink
- haiku in the list of target that support the ide
- some more fix in some packages
git-svn-id: trunk@11135 -
to group multiple products
* OnGetVendorName hook, like OnGetApplicationName
* use COMMON_APPPATH for global config files under windows
git-svn-id: trunk@10072 -
for qwordbool) + test:
o assigning true to such a variable now sets them to $ff/$ffff/$ffffffff
o these types are now all signed
o converting an integer type to a byte/word/long/qwordbool using an
explicit type cast keeps the integer's original value stored in the
bool, instead of forcing it to ord(true)/ord(false)
(mantis #10233 and #10613, implemented for all architectures, testsuite
tested for ppc32, sparc and x86)
* fixed some places where the rtl depended on longbool(true) having the
value 1
* extended several boolean tests (and adapted some to no longer assume
that byte/word/long/qwordbool(true)=1)
+ support for converting to qwordbool in second_int_to_bool for x86, ppc
and sparc
git-svn-id: trunk@9898 -
* optimized LowerWideString/UpperWideString not to call UniqueString
for each string character
* fixed LowerAnsiString/UpperAnsiString in case an ascii character
has a lower/uppercase version with a different length than 1
+ generic test for ansistring comparisons using on the widestring
manager (based on glibc test)
- removed ansi2ucs4-related stuff as it's not used/needed
git-svn-id: trunk@9440 -
a widestring as end-of-string + test (which fails on Darwin/FreeBSD
in utf-8/utf-16 locales, because their libc's wcscoll is documented
as only working in single-byte locales and falling back to wcscmp
for others)
git-svn-id: trunk@9416 -
platform)
+ mbstate_t type for all unixes except BeOS (doesn't exist for BeOS)
+ implemented UpperAnsiStringProc/LowerAnsiStringProc for unix
* fixed Ansi2UCS4Move in cwstring (although it isn't used anywhere
currently)
+ test for Upper/LowerAnsiString
git-svn-id: trunk@9393 -
* correctly define the stack size for BeOS,
+ implement a minimum nl_langinfo function to correctly initialize WideString support
+ add fgl unit in the BeOS RTL makefile
* SysOSAlloc now return nil when the system can not allocate the asked memory,
* HAS_SYSOSFREE is no more defined with an empty implementation under BeOS. This was preventing FPC to reuse memory.
+ there is now a basic implementation of CheckPointer under BeOS.
git-svn-id: trunk@8994 -
(widechar<->char, widechar<>*string), based on patch from
Rimgaudas Laucius (mantis #7758)
* no longer perform compile-time widechar/string->char/ansi/
shortstring conversions if they would destroy information
(they can't cope with widechars with ord>=128). This means
that you can now properly constant widechars/widestrings
in source code with a {$codepage } set without risking that
the compiler will mangle everything afterwards
* support ESysEINVAL return code from iconv (happens if last
multibyte char is incomplete)
* fixed writing of widechars (were converted to char -> lost
information)
git-svn-id: trunk@8274 -
file descriptor + 1 as first parameter, select can also be EIntr)
* changed IntbasiceventWaitFor (used by syncobjs) so it can emulate
timeouts (using a loop and short sleeps) (mantis #9414)
* also added wrAbandoned support to IntbasiceventWaitFor
* enhanced tbrtlevt.pp to test new functionality
git-svn-id: trunk@8257 -
immediately terminates the whole application), but instead call
handleerrorframe (which can be converted into an exception) (#7954)
git-svn-id: trunk@8248 -
* educated guess this is the case on arm-linux as well
* temporary change: do not alias clongdouble from unixtype into ctypes to prevent
having to work in two places.
git-svn-id: trunk@8127 -
manager now has two extra parameterless procedures (ThreadInitProc
and ThreadFiniProc) which are called whenever a thread begins/ends,
and cwstring uses these to create separate iconv handles for
each thread (via threadvars)
* renamed UCS4 to UCS-4BE/LE, because UCS4 is not recognised by most
systems
* clean up all iconv handles on exit, and check whether they are
valid before doing so
git-svn-id: trunk@7949 -
setlocale(LC_ALL,'') per POSIX, which initialises the langinfo stuff
based on the environment variables (some OS'es do that automatically,
but at least Darwin and Solaris don't)
git-svn-id: trunk@7672 -
(Vinzent Hoefler)
* simplified CWaitForThreadTerminate based on comments from Vinzent
Hoefler
* fixed resource leaks where in some cases a pthread would not be
reaped based on comments from Vinzent Hoefler (resolves#9016)
git-svn-id: trunk@7588 -
Linux-specific (and at least under Mac OS X, there seems to be
no way to play sound without going via the Carbon/Quicktime/...
frameworks)
git-svn-id: trunk@7488 -
* iconv is in libc for solaris
* use official names for unicode encodings (UTF-16BE/UTF-16LE instead
of unofficial UNICODEBIG/UNICODELITTLE aliases, which are not supported
by solaris' iconv)
git-svn-id: trunk@7452 -
on unix
* fixed some dataraces in unix' suspend/resume (although they can't
be solved completely due to no possibility to atomically
suspend/resume and set fsuspended at the same time)
git-svn-id: trunk@5677 -
sem_open/sem_close for Darwin (doesn't have sem_init/sem_destroy)
+ implementation of cSemaphore* based on pipes (for potential future
systems that don't have either sem* routines)
+ test for basicrtlevent
* fixed datarace whereby a TThread could be started, run and exit before
TThread.AfterConstructor had been called (Mantis 6693, all platforms)
* throw EThread exceptions in TThread.create if something during creating
the tthread goes wrong (*nix)
* don't crash in TThread.Destroy if the TThread throws an exception before
it was fully initialised (*nix)
* changed order of operations in TThread.Destroy so it doesn't perform
invalid thread operations in some edge cases (*nix)
* fixed usage of sem_wait/sem_trywait (can be interrupted) in Semaphore
and RTLEvent implementations
* fixed erroneous waiting for threads after they had already exited via
pthread_detach/pthread_exit
* fixed several memory leaks in case of thread intialisation errors
(*nix)
* unified tthread.inc for all Unices
git-svn-id: trunk@5662 -
- Remove sysutils dependency by turning exception into runerror, which is
converted into exception anyway if user decides to use sysutils.
git-svn-id: trunk@5471 -
+ added kld* syscalls for freeBSD (tested)
+ changed "directives" macro for freeBSD unit to "extdecl" for Lazarus
+ changed MAXPATHLEN from 255 (wrong on all unices known to fpc since 1993) to 1024 for non-linux and 4096 for linux as per source code (2.4+ for linux, 1993 BSD for BSDs, Solaris 10)
git-svn-id: trunk@4779 -