Commit Graph

1182 Commits

Author SHA1 Message Date
svenbarth
f46b8539d0 * implement FileSymLinkGetTarget for *nix systems
git-svn-id: trunk@43113 -
2019-10-03 12:07:33 +00:00
svenbarth
2a38d07d8f * implement FollowLink=False handling for DirectoryExists and FileExists on *nix systems
git-svn-id: trunk@43112 -
2019-10-03 12:07:28 +00:00
svenbarth
46dac1419e * fix FileExists on *nix systems returning True for directories
git-svn-id: trunk@43111 -
2019-10-03 12:07:25 +00:00
michael
db4bc06b67 * dlinfo call added (bug ID 0036105)
git-svn-id: trunk@43097 -
2019-09-29 22:28:47 +00:00
Jonas Maebe
693e72ade3 * Darwin now uses Mach VM calls for memory allocation instead of mmap/munmap
+ added sysrealloc support for Darwin (Darwin does not have mremap)

git-svn-id: trunk@42729 -
2019-08-18 15:55:07 +00:00
florian
f0213a2c46 + make use of the mremap syscall of linux to re-allocate large memory blocks faster
git-svn-id: trunk@42713 -
2019-08-16 20:47:37 +00:00
svenbarth
c26348a3dd * follow up to r42457: FreeTerminateProcs needs to be called before DoneExceptions just in case an exception is triggered due to a corrupted list
git-svn-id: trunk@42461 -
2019-07-20 08:41:59 +00:00
svenbarth
176a63b67b * fix for Mantis #35862: free the list of functions added with AddTerminateProc to avoid memory leaks
+ added test

git-svn-id: trunk@42457 -
2019-07-19 15:55:21 +00:00
Jonas Maebe
faf75095cd * synchronised with trunk till r42189
git-svn-id: branches/debug_eh@42190 -
2019-06-07 18:24:38 +00:00
svenbarth
90278f4859 + add fpmprotect function to complete fpmmap/fpmunmap
git-svn-id: trunk@42181 -
2019-06-06 20:46:01 +00:00
Jonas Maebe
9e9a982bfe * synchronised with trunk till r42095
git-svn-id: branches/debug_eh@42096 -
2019-05-18 18:43:51 +00:00
pierre
c8129c5228 Disable 64-bit version of CPU_SOURCE is 32-bit
git-svn-id: trunk@42081 -
2019-05-16 08:21:09 +00:00
Jonas Maebe
1b6425176b * synchronised with trunk till r42049
git-svn-id: branches/debug_eh@42050 -
2019-05-12 18:44:05 +00:00
pierre
a7a67f3d3c * Improve handling of command line args setting variables (did not work if it contained spaces)
+ Group all recognized macros into list_defines in preproc.awk file
  + Convert Pascal style hexadecimal constants into C style

git-svn-id: trunk@42018 -
2019-05-07 08:13:38 +00:00
pierre
0a3a35152d Also remove -m32 option for arm native GNU C compiler
git-svn-id: trunk@42017 -
2019-05-06 22:07:49 +00:00
pierre
12647c348e Add script to use h2paschk on t_OS.h2paschk file for rtl tests for system header compliance
git-svn-id: trunk@42015 -
2019-05-06 21:10:12 +00:00
pierre
cb4b085a99 * Also allow '-' in include file names
+ Add os_cpu and cpu_source variables
  * Cope with aarch64 GNU C compiler that does not support -m64 option
  + Add support for arm test on aarch64 machine
  * Better accept expressions instead of constants in C #define

git-svn-id: trunk@42014 -
2019-05-06 21:08:47 +00:00
Jonas Maebe
3a1fb45315 * synchronised with trunk till r41976
git-svn-id: branches/debug_eh@41977 -
2019-05-02 19:44:41 +00:00
pierre
0100c4abf8 More improvements to script testing syscall numbers
git-svn-id: trunk@41970 -
2019-05-02 12:55:51 +00:00
pierre
5f4a0c7af7 * freebsd and openbsd also use sys/syscall.h header
+ Add AWK parser to removed parts of source not concerning current CPU
    (only handles CPUXXX like CPUI386)

git-svn-id: trunk@41969 -
2019-05-01 22:00:06 +00:00
pierre
639adc314f Eliminate wrong line (bug report 35441)
git-svn-id: trunk@41934 -
2019-04-25 13:04:39 +00:00
pierre
a83bc62639 Improve syscall number testing script:
+ Add support for parameters:
    -v sets verbose variable to 1
    VAR=value gets evaluated.
  * moves to rtl/$os if called at diferent level.
  + check if there is a incude directive in sysnr.inc file.
  + Add compilation of C source code with the C variant of the syscall number.
  + Support 32 and 64-bit version of C compilation for systems
    allowing 32 and 64-bit executable (like x86_64-linux).
  + Add 'preprocessing' using AWK to test {$ifdef CPUXXX} macro.
  + Add summary at end of script.
  * Rename check_syscall_number to check_c_syscall_from_fpc_rtl
  * Rename check_syscall_number_reverse to check_c_syscall_in_fpc_rtl
  * Try to remove most intermediate files.
  + Generate add_missing_syscalls.inc file if numbers are missing.

git-svn-id: trunk@41928 -
2019-04-25 06:10:43 +00:00
Jonas Maebe
d93c05a90c * synchronised with trunk till r41207
git-svn-id: branches/debug_eh@41208 -
2019-02-03 21:05:37 +00:00
nickysn
248fd313f8 + introduced unit SortBase, which implements the foundation for pluggable
sorting algorithms. A default QuickSort implementation is provided by the
  unit. Other units can be added, to provide other sorting algorithms (e.g.
  HeapSort, MergeSort, IntroSort, etc.)
* TList and TFPList updated to use the current default sorting algorithm defined
  in SortBase for their .Sort method.

git-svn-id: trunk@41167 -
2019-02-02 20:06:50 +00:00
Jonas Maebe
b3a8543a56 * synchronised with trunk till r40942
git-svn-id: branches/debug_eh@40943 -
2019-01-20 17:37:07 +00:00
Károly Balogh
e547dfa837 haiku: update baseunix unit, remove syscalls code, flock() and nanosleep() is actually supported on Haiku for a long time now, so lets use it
git-svn-id: trunk@40823 -
2019-01-10 03:51:35 +00:00
Jonas Maebe
b41cd1eb6a * synchronised with trunk till r40575
git-svn-id: branches/debug_eh@40576 -
2018-12-16 20:45:55 +00:00
michael
d49510cc8c * Fix bug #0034499
git-svn-id: trunk@40548 -
2018-12-14 10:00:44 +00:00
Jonas Maebe
bd23ac0dab - disable I/O-port-related intrinsic functionality when using LLVM, as the
x86-specific inline nodes are not available then

git-svn-id: branches/debug_eh@40437 -
2018-12-01 20:30:43 +00:00
florian
72416edcc4 + support for tlsm_general on i386-linux
git-svn-id: trunk@40281 -
2018-11-11 17:32:20 +00:00
florian
9c041afc7c * disable generic threadvar handling if section thread vars are available
git-svn-id: trunk@40270 -
2018-11-07 22:03:01 +00:00
yury
b717a149b6 * android: Removed cwstring from the uses clause of the unix unit. Use cwstring indirectly. It allows to avoid using cwstring if needed.
git-svn-id: trunk@40198 -
2018-11-03 12:34:59 +00:00
yury
5e92e2d23f * Fixed crash in DiskFree() and DiskSize() on Unices due to out of bound read of the DriveStr[] array in rare cases.
git-svn-id: trunk@39866 -
2018-10-06 13:52:56 +00:00
yury
23006d16f5 * Fixed UnhookSignal when RTL_SIGDEFAULT is passed. The bug have caused crash on aarch64-android due to out of bounds read of the rtlsig2ossig[] array.
git-svn-id: trunk@39860 -
2018-10-05 18:33:55 +00:00
pierre
0e6c072365 define iconv_is_in_libc by default for netbsd OS (can be disabled by adding -dDISABLE_ICONV_LIBC option
git-svn-id: trunk@39801 -
2018-09-24 22:20:30 +00:00
svenbarth
09e5f463dc + add Delphi-compatible FileGetSymLinkTarget functions to all platforms (currently returns False on all platforms); this also includes TSymLinkRec variants for both RawByteString and UnicodeString
git-svn-id: trunk@39669 -
2018-08-24 15:33:45 +00:00
svenbarth
92dcdd8b5b + add Delphi compatible FollowLink parameter (default is True) to FileExists and DirectoryExists; support for it is up to each target
git-svn-id: trunk@39668 -
2018-08-24 15:33:09 +00:00
nickysn
7df861487b * use include files in the unix ports unit as well
+ add portsh.inc and ports.inc for x86_64 as well

git-svn-id: trunk@39420 -
2018-07-09 14:42:01 +00:00
nickysn
f733e0a31c + use the x86 inline intrinsics for port access in the unix ports unit as well
git-svn-id: trunk@39372 -
2018-07-04 00:17:18 +00:00
nickysn
3ed284953b * use the new x86 port access intrinsics in the x86 unit for unix
git-svn-id: trunk@39371 -
2018-07-03 23:25:18 +00:00
Károly Balogh
ab1a82bfb3 fix typo in comment. no functional change.
git-svn-id: trunk@37567 -
2017-11-07 15:50:59 +00:00
pierre
0c7646761f Also disable pthread_attr_setinheritsched call for BeOS
git-svn-id: trunk@37266 -
2017-09-20 13:56:05 +00:00
pierre
98be7e67f1 Disable FpSigTimedWait also for BeOS
git-svn-id: trunk@37259 -
2017-09-20 08:49:12 +00:00
marco
b6824290fc * initial fileflush, mantis #15824
git-svn-id: trunk@37135 -
2017-09-03 16:41:32 +00:00
marco
d98065d706 * change external name of wait to wait instead of waitpid. Reported
by Toshihiko Okuhara, mantis #32288

git-svn-id: trunk@36858 -
2017-08-08 10:56:54 +00:00
michael
52cd572cec * Use specific type for TFPSet elements
git-svn-id: trunk@36710 -
2017-07-09 14:47:27 +00:00
florian
a927181d87 * properly align threadvars for sparc64
git-svn-id: trunk@36694 -
2017-07-08 21:22:40 +00:00
svenbarth
d5c8fe7455 * on targets with indirect main entry argc, argv and envp are provided through the indirect entry information instead of externals
git-svn-id: trunk@36686 -
2017-07-08 19:18:20 +00:00
florian
453fedf089 * empty lines removed
git-svn-id: trunk@36541 -
2017-06-19 21:17:56 +00:00
florian
1b371b15e3 * make webtbs/tw30535 also working on OSes using cthreads
git-svn-id: trunk@35570 -
2017-03-12 09:28:41 +00:00
Jonas Maebe
6d5339cdb6 * CP819/IBM819 should be mapped to Windows code page 28591 (ISO8859-1)
(mantis #30639)

git-svn-id: trunk@35397 -
2017-02-04 22:44:36 +00:00
michael
d05175a17f * FileOpen should not open directories (Windows compatible) Bug ID #30766
git-svn-id: trunk@35063 -
2016-12-04 12:41:57 +00:00
yury
1ccf551d1c * android: Try to get the package files directory for any shared library. If it is valid use it as a home dir.
* android: Always set the syslog tag.

git-svn-id: trunk@34926 -
2016-11-20 10:53:23 +00:00
Jonas Maebe
1c04470b66 * converted for-loop to while-loop, because its loop count is used on exit
even if no break is triggered

git-svn-id: trunk@34776 -
2016-11-01 14:01:41 +00:00
Jonas Maebe
85f2903b8b * don't index past the end of the transitions array (mantis #30829)
git-svn-id: trunk@34775 -
2016-11-01 14:01:38 +00:00
sergei
67bd4775fd - Cleaned out thread manager semaphore support which was ever implemented only for Unix, and not used since r28965. This also reverts changes to System unit interface introduced in r27665.
git-svn-id: trunk@34542 -
2016-09-20 20:14:36 +00:00
florian
16ac523f50 * link always excplicitly against libc on linux when using the dl unit so
the correct startup code is used

git-svn-id: trunk@34370 -
2016-08-22 14:16:21 +00:00
florian
80fc6a459c * corrected r34366 (powerpc -> cpupowerpc)
git-svn-id: trunk@34368 -
2016-08-22 10:23:09 +00:00
florian
385f13cae9 * excplicitly link against libc in the unit dl, so the correct startup files are used, resolves issue #29594
git-svn-id: trunk@34366 -
2016-08-22 10:03:58 +00:00
yury
7756dab2bf * android: Create app files dir if needed.
git-svn-id: trunk@34356 -
2016-08-20 12:41:36 +00:00
yury
419c6ce61e * android:
+ API to write to the Android system log. 
  + API to redirect standard output and error to the Android system log. The redirection is performed automatically for shared libraries loaded by Java applications.

git-svn-id: trunk@34352 -
2016-08-19 20:21:52 +00:00
yury
3822515bd9 * android: Fixed GetAppConfigDir, GetAppConfigFile, GetUserDir, GetTempDir to return correct writable locations. For NDK libraries, the path to local storage of host Java app is used. For console apps the /data/local/tmp is used.
git-svn-id: trunk@34351 -
2016-08-19 18:07:57 +00:00
yury
064375ea72 * android: Use ICU to get timezone information if running on an Android version where libc does not implement timezone.
git-svn-id: trunk@34348 -
2016-08-19 14:57:02 +00:00
yury
2630f3c498 * android: Properly initialize time zone information.
git-svn-id: trunk@34332 -
2016-08-18 14:03:34 +00:00
Jonas Maebe
60d75fa97e * fixed (harmless) range error in 64 bit BSD-based RTLs
git-svn-id: trunk@33736 -
2016-05-21 14:48:32 +00:00
michael
960963e74b * SearchAttr needs more bits (faSymlink=$400), bug ID #29870
git-svn-id: trunk@33340 -
2016-03-27 00:01:14 +00:00
marco
66608fec02 * unicode executeprocess from work during Lazarus convention in IJsselstein
git-svn-id: trunk@33290 -
2016-03-19 17:59:42 +00:00
marco
581f1188a5 * deprecated dt routines in unixutils. Julian routines already were
duplicated to the implementations of dos & sysutils.
   localtoepoch and vv not yet.

git-svn-id: trunk@32378 -
2015-11-20 15:06:29 +00:00
michael
b651a8925e * Observe TZ and TZDir when determining timezone
git-svn-id: trunk@32369 -
2015-11-19 22:34:23 +00:00
michael
9447b975f2 * Fix bug #28987, fpfd_clr, and fpfdfillset using cardinal instead of correctly sized culong
git-svn-id: trunk@32329 -
2015-11-15 12:14:14 +00:00
michael
fde42ca8ef * Type helpers, compatible to Delphi XE 8
git-svn-id: trunk@32262 -
2015-11-07 09:40:54 +00:00
marco
266ebc351b * remove some deprecated functions. Most have alternatives since at least 2.4, and more often 2.2
I left getdomainname in "unix" for now, I don't know the exact status.

git-svn-id: trunk@32255 -
2015-11-06 14:55:38 +00:00
Jonas Maebe
f0c0b00467 * avoid threadvar memory leaks for external hooked threads if the tlskey
thread data is finalised by libpthread before the CleanupKey routine
    is called (based on patch by Derek, mantis #28806)

git-svn-id: trunk@32168 -
2015-10-27 21:52:05 +00:00
yury
7688639a10 * Return a real base address for ELF executables by GetModuleByAddr() instead of hard-coded 0.
* Obtain a real processaddress for ELF images by OpenExeFile() instead of hard-coded 0.
* It fixes line info information for Position Independent Executables (PIE).

git-svn-id: trunk@32052 -
2015-10-13 20:08:03 +00:00
yury
e1a0b1204a * Removed unused vars in RTL.
git-svn-id: trunk@31750 -
2015-09-17 16:48:53 +00:00
yury
6f15b5bf63 * Use /data/local/tmp/ as a fallback temp dir on Android.
git-svn-id: trunk@31720 -
2015-09-16 16:37:17 +00:00
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
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