Commit Graph

2973 Commits

Author SHA1 Message Date
nickysn
28dc9fe68b * fixed definition of the ALUSInt type on 16-bit CPUs
git-svn-id: trunk@30453 -
2015-04-05 21:47:32 +00:00
florian
134457fb8c + define types depending on the ALU register size of the CPU, e. g. for most 8 Bit CPUs this is different from Ptr(U)Int, and e.g. also for the far pointer memory models of i8086
git-svn-id: trunk@30451 -
2015-04-05 21:25:03 +00:00
florian
9ab9e03650 * limit number of possible units with initialization/finalization for a certain architecture to high(aint)
+ give an error if the number of possible units is exceeded

git-svn-id: trunk@30450 -
2015-04-05 21:06:58 +00:00
florian
98856437b2 * disable fpc_chararray_enum for now on avr because the register allocator cannot currently handle it
git-svn-id: trunk@30380 -
2015-03-29 19:46:02 +00:00
florian
d0f4e7cc99 * respect feature defines
git-svn-id: trunk@30378 -
2015-03-29 19:43:25 +00:00
Jonas Maebe
bd203a5b57 * synchronised with trunk till r30240
git-svn-id: branches/hlcgllvm@30241 -
2015-03-15 19:44:58 +00:00
svenbarth
dcfd734bbf Fix cycling with -dFPC_USE_LIBC on Linux systems to allow usage of FPC Linux programs on OSv.
memchr seems to have a bug on recent Linux systems if the count that is passed in is larger than the buffer (in our specific case the count is -1 to find the 0 byte of \0 terminated strings): the function "randomly" fails to find the byte and returns zero thus leading to for example incorrect parameter handling.

rtl/inc/cgeneric.inc:
  * use rawmemchr on Linux if -1 is passed as count

git-svn-id: trunk@30160 -
2015-03-10 18:34:04 +00:00
Jonas Maebe
6a70c84258 + internal bsr/bsf support for ppc32 and ppc64
git-svn-id: trunk@30152 -
2015-03-09 16:48:34 +00:00
Jonas Maebe
67b8aceaee * synchronized with privatetrunk till r30095
git-svn-id: branches/hlcgllvm@30101 -
2015-03-05 20:32:15 +00:00
Jonas Maebe
b4033efc00 * fixed typo in comment
git-svn-id: trunk@30079 -
2015-03-02 21:45:43 +00:00
Jonas Maebe
60dbce940a * converted readstr/writestr to use system.Utf8CodePointLen()
git-svn-id: trunk@30049 -
2015-03-01 17:12:24 +00:00
Jonas Maebe
ff020a3be4 + "Utf8CodePointLen(pansichar,MaxLookAhead,IncludeCombiningDiacriticalMarks):
sizeint"  function that returns:
   <0: invalid sequence detected after processing "-result" bytes
   0:  incomplete (may still be valid if MaxLookAhead is increased)
   >0: sequence of result bytes forms a codepoint (+ combining diacritical
       marks if that parameter was true)

git-svn-id: trunk@30047 -
2015-03-01 17:12:17 +00:00
Jonas Maebe
416d0b3974 * enable internal handling of 64 bit sar() on AArch64
git-svn-id: trunk@29983 -
2015-02-23 22:57:15 +00:00
Jonas Maebe
a8d05b66e2 + AArch64 internal bsf/bsr support
git-svn-id: trunk@29979 -
2015-02-23 22:57:02 +00:00
Jonas Maebe
03f8a15904 * enable internal handling of 32 and 64 bit rotates on AArch64
git-svn-id: trunk@29977 -
2015-02-23 22:56:56 +00:00
Jonas Maebe
5a8959381c + Darwin/AArch64 support
git-svn-id: trunk@29934 -
2015-02-23 22:53:50 +00:00
Jonas Maebe
6d0f0f430d * added Darwin/AArch64 support to the objc unit
git-svn-id: trunk@29927 -
2015-02-23 22:53:20 +00:00
Jonas Maebe
b0112fa63f + initial AArch64 support in systemh.inc, options.pas, version.pas and
psystem.pas

git-svn-id: trunk@29903 -
2015-02-23 22:52:04 +00:00
Jonas Maebe
5c6afe259e * long double = double on Darwin/AArch64
git-svn-id: trunk@29888 -
2015-02-23 22:51:15 +00:00
Jonas Maebe
dad442c7e3 + aarch64 fpu init, atomic routines and memory barriers
git-svn-id: trunk@29885 -
2015-02-23 22:51:06 +00:00
pierre
f56990ee29 Revert aligntoptr to RTTIAlign rename
git-svn-id: trunk@29739 -
2015-02-17 07:35:31 +00:00
sergei
72315c9bee * Finalize units after printing the runtime error message. Rationale:
* Unit finalization executes arbitrarily large amount of code. Doing it when error occurred can cause
    other errors, overwriting the original error information.
  * Code that prints error message depends on everything and a kitchen sink (most notably, Unicode manager
    and lineinfo unit). Running it after finalizing units can be successful only by coincidence.
  * Last but not least, this sequence (ExitProc -> print RTE -> finalize units) is same as one used in Delphi.

git-svn-id: trunk@29733 -
2015-02-16 22:05:54 +00:00
sergei
7666cd5c0e + Overloaded procedure dump_stack that calls CaptureBacktrace, thus encapsulating internals of stack traversing.
* Use this new procedure in heaptrc unit.

git-svn-id: trunk@29713 -
2015-02-15 20:00:24 +00:00
pierre
42cc1d504f Avoid warnings by adding noreturn modifiers to dummy dynamic library manager
git-svn-id: trunk@29711 -
2015-02-15 18:03:11 +00:00
sergei
d93d36e6d3 * Win64: Use separate implementation of CaptureBacktrace that calls RtlCaptureStackBackTrace. This way it does not require non-optimized code to work correctly.
git-svn-id: trunk@29692 -
2015-02-14 11:41:33 +00:00
sergei
438c433c50 * CaptureBacktrace: fixed off-by-one error. Caller's context must be captured if skipframes=0.
git-svn-id: trunk@29691 -
2015-02-14 02:50:03 +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
marco
576c754034 * corrected typo.
git-svn-id: trunk@29546 -
2015-01-24 23:30:31 +00:00
Jonas Maebe
146e3bcb9e * synchronised with trunk till r29513
git-svn-id: branches/blocks@29516 -
2015-01-21 23:28:34 +00:00
marco
0abb3f3e02 * fixed capitalization Int64 and added qword
git-svn-id: trunk@29470 -
2015-01-13 17:18:29 +00:00
marco
db43ec946f * definition of internal type int64 for documentation purposes.
git-svn-id: trunk@29469 -
2015-01-13 17:14:51 +00:00
marco
6db1f5bfa8 * Delphi compat changes pchar->pansichar. add pppansichar to systemh.inc
git-svn-id: trunk@29375 -
2015-01-03 13:54:59 +00:00
marco
4733e50de5 * system unit additions from mantis #27206. Exports some dynarray related RTTI functions.
git-svn-id: trunk@29364 -
2015-01-01 00:21:40 +00:00
Jonas Maebe
cec82a1540 * translate placeholder code page numbers into actual code pages in
fpc_ansistr_to_widechararray(), so that CP_ACP/CP_OEM etc are properly
    handled (fixes assign/assignfile with non-ansi characters in source files
    that don't explicitly specify the code page)

git-svn-id: trunk@29218 -
2014-12-08 12:11:33 +00:00
marco
2578514853 * first dragonfly patch (existing most). Mantis #27091
git-svn-id: trunk@29213 -
2014-12-07 20:27:02 +00:00
sergei
92447a9a20 * Moved local typed constants having the same value in several routines to global scope.
git-svn-id: trunk@29207 -
2014-12-06 13:07:32 +00:00
pierre
606b0a99c7 Remove wrong close call after failed Reset
git-svn-id: trunk@29200 -
2014-12-04 13:10:08 +00:00
sergei
ae68a4962f - RTL: merged functionality of InitWideStringManager into InitUnicodeStringManager and removed the former.
git-svn-id: trunk@29130 -
2014-11-23 21:09:00 +00:00
nickysn
4fe1ec9c51 * fixed TSingleRec.SetSign on 16 and 8-bit CPUs
git-svn-id: trunk@29120 -
2014-11-23 14:14:03 +00:00
sergei
3a5e6485b5 - RTL: removed InitVariantManager, it was an empty procedure since day 1.
git-svn-id: trunk@29114 -
2014-11-22 20:35:46 +00:00
florian
7180d184c5 + implements TExtended80Rec, TDoubleRec, TSingleRec
+ test

git-svn-id: trunk@29084 -
2014-11-16 20:47:33 +00:00
michael
3563944752 * Patch to allow changing TVarRec data (bug ID 26773)
git-svn-id: trunk@28995 -
2014-11-05 22:17:54 +00:00
Jonas Maebe
87e55caabc * declare tvarrec.vpchar explicitly as pansichar for documentation purposes
(mantis #26842)

git-svn-id: trunk@28823 -
2014-10-15 15:37:23 +00:00
Jonas Maebe
ff583bde6c * made setstring() a compiler intrinsic so it can set the compile-time
code page of ansistrings (mantis #26735)

git-svn-id: trunk@28813 -
2014-10-12 20:27:06 +00:00
Jonas Maebe
d9c13d892e + added fpc_in_aligned forgotten in r23310
git-svn-id: trunk@28812 -
2014-10-12 20:27:04 +00:00
nickysn
d8a9860e92 + optimization in tinyheap's reallocmem for the case when there's not enough
space after the block, but it becomes enough when the space before the block
  is also reclaimed

git-svn-id: trunk@28786 -
2014-10-07 14:36:23 +00:00
Jonas Maebe
427b05e97c * converted TVMTWriter.intf_write_table() to the high level typed constant
builder
   o removed variant record part in the RTL to force a specific size/alignment,
     since we now import the record into the compiler and hence it will always
     be handled correctly

git-svn-id: branches/hlcgllvm@28777 -
2014-10-06 20:54:23 +00:00
florian
714901ce45 * fixes feature defines after recent changes
git-svn-id: trunk@28743 -
2014-10-04 18:12:09 +00:00
florian
03c553606e - unneeded spaces removed
git-svn-id: trunk@28740 -
2014-10-04 13:45:17 +00:00
nickysn
1e0a69fa7f + optimizations in SysTinyReAllocMem for the case when growing the heap block
and there is enough free space after the block

git-svn-id: trunk@28723 -
2014-09-29 09:48:45 +00:00