Commit Graph

1006 Commits

Author SHA1 Message Date
Jonas Maebe
4e0d546323 * Use mbrlen instead of mblen under Haiku like on other Unix like platforms.
This fixes the twide3 unit test (patch by Olivier Coursière, mantis #28538)

git-svn-id: trunk@31427 -
2015-08-25 21:26:05 +00:00
Jonas Maebe
dc1f5f1a13 * Haiku use UTF-8 from day one, so it make sense to use the corresponding
code page as the default one (patch by Olivier Coursière, mantis #28520)

git-svn-id: trunk@31333 -
2015-08-16 13:22:57 +00:00
Jonas Maebe
7f61cf5519 * Modify CODESET value according to the corresponding declaration in
langinfo.h under Haiku (patch by Olivier Cousière, mantis #28523)

git-svn-id: trunk@31329 -
2015-08-16 13:22:45 +00:00
michael
4242934edb * Fixed ftruncate to take 64-bit argument
git-svn-id: trunk@30892 -
2015-05-21 07:32:30 +00:00
Jonas Maebe
9b987fde93 * fmShareDenyNone should also take a shared lock (+ test)
git-svn-id: trunk@30877 -
2015-05-17 11:08:08 +00:00
Jonas Maebe
31037d0664 * when creating a file with an exclusive sharing mode on Unix, first check
whether there isn't already a file and of so whether we can open it using
    this exclusive sharing mode (since the locking is advisory, simply
    overwriting any existing file and then locking it exclusively will
    always work) (mantis #27998)

git-svn-id: trunk@30861 -
2015-05-15 19:45:12 +00:00
michael
8196427ca6 * Patch from Bernd to fix SedDateTime (wrong tv_usec values, bug ID #27969)
git-svn-id: trunk@30728 -
2015-04-26 08:43:47 +00:00
michael
9bf410e6a0 * Fix bug ID #27617, heap messed up due to not resetting pointer
git-svn-id: trunk@30368 -
2015-03-29 15:54:49 +00:00
Jonas Maebe
1e227f78fe * factored out the check for whether we have to generate dotted function
names, and disabled them for ppc64 ELFv2
  * disabling those also disables the function descriptors, so use the
    _CALL_ELF compiler variable to check whether there is in fact a
    function descriptor

git-svn-id: trunk@30196 -
2015-03-14 18:35:25 +00:00
Jonas Maebe
6defd861b0 * fixed uninitialized function result in r30048 (mantis #27586)
git-svn-id: trunk@30078 -
2015-03-02 21:45:40 +00:00
Jonas Maebe
9da8a2304a * converted matching UTF-8 filenames in findfirst/findnext to use
system.Utf8CodePointLen()

git-svn-id: trunk@30048 -
2015-03-01 17:12:21 +00:00
Jonas Maebe
5a8959381c + Darwin/AArch64 support
git-svn-id: trunk@29934 -
2015-02-23 22:53:50 +00:00
svenbarth
2d454dc8fa Move DynLibs support to System unit using a manager approach like for Threads, WideStrings, etc.. This is needed so that we can support features like "delayed" and loading of dynamic packages.
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 -
2015-02-03 20:00:00 +00:00
Jonas Maebe
16183bebfe * libc's open() function is a varargs function
git-svn-id: trunk@29585 -
2015-01-30 19:31:25 +00:00
yury
b401a90eab * Re-enable UnixGetModuleByAddrHook for Android to fix back traces for libraries. Get dladdr() dynamically at run-time to support older versions of Android.
git-svn-id: trunk@29401 -
2015-01-05 00:45:07 +00:00
Jonas Maebe
b0c7415f3a * fixed CharLengthPChar() implementation and added comment (from Windows
sysutils unit) about what it does (this routine currently isn't used
    anywhere, so the bugs didn't really have any impact)

git-svn-id: trunk@29378 -
2015-01-03 22:58:10 +00:00
Jonas Maebe
63bd65942b * fall back to UTF-8 for darwin in unixcp.GetSystemCodePage if no LC_*/LANG
environment variables are set
  * if no LC_*/LANG environment variables are set, let cwstring fall back to
    unixcp.GetSystemCodePage
   o this is mainly to avoid problems on OS X, where under certain
     circumstances these variables are not set for GUI programs and
     as a result we set the system code page to ASCII

git-svn-id: trunk@29257 -
2014-12-11 19:11:11 +00:00
marco
2578514853 * first dragonfly patch (existing most). Mantis #27091
git-svn-id: trunk@29213 -
2014-12-07 20:27:02 +00:00
pierre
1d1215ede3 Include setsysnr.inc and call SetSyscallNumbers if FPC_HAS_SETSYSNR_INC is defined
git-svn-id: trunk@29135 -
2014-11-23 21:57:33 +00:00
pierre
7bbb30ccd4 * Reset filerec mode field to fmClosed if the system call to open the file failed
git-svn-id: trunk@29132 -
2014-11-23 21:49:29 +00:00
pierre
90537e94a0 Call Errno2noutres if system call to close the handle fails in do_close for win and unix
git-svn-id: trunk@29095 -
2014-11-20 22:00:35 +00:00
pierre
1fcc0490fe Also use PHTREAD_INHERIT_SCHED in pthread_attr_setinheritedsched for NetBSD system
git-svn-id: trunk@29055 -
2014-11-10 23:10:27 +00:00
pierre
42be0dd306 Use ptruint instead of longint cast for self address for WRITE_DEBUG
git-svn-id: trunk@29054 -
2014-11-10 23:09:06 +00:00
Jonas Maebe
77c1364713 * replaced use of semaphores in Unix version of TThread for suspend/resume
functionality with RTLEvent:
   o the thread manager semaphore functionality isn't used for anything else,
     and the main difference between mutex/condvar and semaphores is that the
     latter can be used for IPC (while the thread manager is always used
     within a single process) and that they are counting (but since a thread
     can only suspend itself nowadays, it cannot be suspended recursively)
   o OS X sandboxing does not support the use of semaphores (or rather: Apple
     does not allow sandboxing rules that enable the use of IPC semaphores in
     the appstore)

git-svn-id: trunk@28965 -
2014-11-02 15:00:24 +00:00
Jonas Maebe
35a313d98c * throw an error if RTLEventCreate() fails on Unix
git-svn-id: trunk@28964 -
2014-11-02 15:00:21 +00:00
Jonas Maebe
79a40547ca - removed no longer used tthread.FSuspendedExternal
git-svn-id: trunk@28963 -
2014-11-02 15:00:14 +00:00
marco
316a50ff23 * support for clock_gettime(), patch by Graeme.
git-svn-id: trunk@28599 -
2014-09-05 13:01:04 +00:00
Jonas Maebe
bee20f79f0 * save original widestring manager on entry and restore it on exit, so that
units finalized afterwards won't try to use the finalized cwstring
    manager (mantis #26252)

git-svn-id: trunk@27842 -
2014-06-01 18:30:49 +00:00
michael
17e34abc62 * Fix for bug ID #18551
git-svn-id: trunk@27773 -
2014-05-11 17:02:56 +00:00
sergei
d7c863185f * Added plain calls for semaphore-related functionality, this removes need to maintain a second copy of thread manager in unis/tthread.inc.
git-svn-id: trunk@27665 -
2014-04-26 13:58:35 +00:00
sergei
471ffb017c - Removed call to FlushThread, it is redundant since r17798. SysFlushStdio is called from DoneThreads, which is in turn called after exiting from ThreadFunc.
git-svn-id: trunk@27663 -
2014-04-26 13:46:10 +00:00
michael
f61e27ec8e * clock_gettime uses timespec, not timeval
git-svn-id: trunk@27446 -
2014-04-02 08:25:03 +00:00
michael
a92056d219 * Use clock_gettime when available
git-svn-id: trunk@27444 -
2014-04-02 07:06:32 +00:00
marco
a818559481 * clocale moved to rtl-extra.
git-svn-id: trunk@27376 -
2014-03-30 15:27:35 +00:00
marco
d6f5ca21b9 * moved units ipc for *BSD, darwin/iphonesim and linux. The others are
makefile cleanups.

git-svn-id: trunk@27373 -
2014-03-30 13:13:13 +00:00
marco
c6424b2e0b * moved unit terminfo to rtl-console
git-svn-id: trunk@27353 -
2014-03-29 21:00:50 +00:00
marco
959ea7f5bb * printer unit moved. Amiga unit also moved but it is not actively used.
git-svn-id: trunk@27351 -
2014-03-29 20:35:28 +00:00
marco
7f8a9bcf6e * serial to rtl-extra
git-svn-id: trunk@27350 -
2014-03-29 20:06:36 +00:00
michael
7ee72ef5a8 * Init threading when setting C thread manager
git-svn-id: trunk@27346 -
2014-03-29 19:31:12 +00:00
michael
2a048692a5 * Patch from Mark Morgan LLoyd, adding some functions (part 2)
git-svn-id: trunk@26855 -
2014-02-23 18:32:09 +00:00
michael
0ecee7cd3f * Patch from Mark Morgan LLoyd, adding some functions
git-svn-id: trunk@26854 -
2014-02-23 18:27:00 +00:00
michael
d91da3bd6b * Patch from Petr-K to take into account modifier - for short date format (bug id 25731)
git-svn-id: trunk@26814 -
2014-02-18 21:23:13 +00:00
marco
f09374a197 * winsock(and -2), sockets and gpm to rtl-extra.
git-svn-id: trunk@26426 -
2014-01-11 19:45:37 +00:00
marco
dea2c743d5 * Initial active version of
rtl-extra : objects matrix ucomplex
   rtl-objpas: convutil(s) dateutil(s) stdconvs variants varutils
   

git-svn-id: trunk@26398 -
2014-01-05 19:20:15 +00:00
Jonas Maebe
729ac297e4 * declare the code page names as ansistring instead of rawbytestring and
force the checked names to CP_ACP, so perform string conversions on
    the names after the compiler bug has been fixed that sets the code
    page of rawbytestring typed constants to CP_NONE

git-svn-id: trunk@26396 -
2014-01-05 18:26:04 +00:00
marco
a001e12d04 * rtl-console initial version.
git-svn-id: trunk@26372 -
2014-01-03 22:19:02 +00:00
marco
0bb6469b80 * remove accidentally inserted BOM, as reported by M. Ring.
git-svn-id: trunk@26358 -
2014-01-02 14:34:28 +00:00
marco
ebe262762a * Clean out of $i textrec and filerec includes that are redundant now that cpstrrtl exposes
those records via system. 

git-svn-id: trunk@26356 -
2014-01-02 13:26:09 +00:00
marco
996e802606 * fix memleak pthread_attr, Mantis #25416 by Henry Vermaak.
git-svn-id: trunk@26220 -
2013-12-11 21:47:02 +00:00
Jonas Maebe
679c6bd27e * fixed formatting
git-svn-id: trunk@26149 -
2013-11-27 20:27:20 +00:00