Commit Graph

31921 Commits

Author SHA1 Message Date
paul
973d947d6c compiler: allow const, type, var and class var sections for objects + test
git-svn-id: trunk@15092 -
2010-03-30 04:22:19 +00:00
paul
2a7636580e tests: fix test name
git-svn-id: trunk@15091 -
2010-03-30 02:55:07 +00:00
paul
06a37d1fb1 compiler: remove dummy assignment
git-svn-id: trunk@15090 -
2010-03-30 01:12:14 +00:00
marco
6a7bc76ca0 * later SM_ constants for getmetrics mantis 16138
git-svn-id: trunk@15089 -
2010-03-29 11:25:26 +00:00
paul
ff1520ab8b compiler: add enumsymtable case to FindUnitSymtable helper
git-svn-id: trunk@15088 -
2010-03-28 21:54:33 +00:00
ivost
a6022f5df2 * removed IImplementorGetter interface and replaced it by the guid IObjectReference.
* GetInterface and GetInterfaceWeak is modified so that when querying for IObjectReference not an interface is returned but the object pointer

git-svn-id: trunk@15087 -
2010-03-28 12:35:50 +00:00
ivost
7025b1ac01 * added supports helper functions for IInterface supports TClass -> TObject,Boolean
git-svn-id: trunk@15086 -
2010-03-28 11:51:38 +00:00
ivost
561997e8ef * added fpc_class_is_corbaintf and fpc_class_cast_corbaintf compiler helper functions
git-svn-id: trunk@15085 -
2010-03-28 11:31:50 +00:00
ivost
d9a6e63ef0 * prepeared compiler functions for IS and cast operators
* IS: fpc_intf_is, fpc_intf_is_class, fpc_class_is_intf
* AS: fpc_intf_cast, fpc_intf_cast_class, fpc_class_cast_intf

git-svn-id: trunk@15084 -
2010-03-28 11:19:56 +00:00
Jonas Maebe
864ca60adb * fixed compilation on 64 bit platforms
git-svn-id: trunk@15083 -
2010-03-28 10:44:34 +00:00
ivost
31067c290e * tiny change: nil i1,i2 by hand so that everything is freed before the "ok".
git-svn-id: trunk@15082 -
2010-03-28 10:10:33 +00:00
ivost
d7e149805b * added new testset for interfaces and delegation, also GetInterface, GetInterfaceWeak, GetInterfaceByStr, AS and IS is tested
git-svn-id: trunk@15081 -
2010-03-28 00:44:20 +00:00
ivost
dc785f6f68 * implemented intf as object. When doing IInterface as TObject the compiler calls fpc_intf_as_class to query for the IImplementorGetter interface and then invokes GetObject to get the
objects reference.
* by default the TInterfacedObject is supporting now IImplementorGetter

git-svn-id: trunk@15080 -
2010-03-28 00:17:20 +00:00
ivost
6560ed87e9 * removed a debug writeln, unfortunately commited by r15077
git-svn-id: trunk@15079 -
2010-03-27 17:06:02 +00:00
ivost
5a588e5f06 * fixed Supports function so that it's using new function GetInterfaceWeak. Supports may have accidentially freed a objects.
git-svn-id: trunk@15078 -
2010-03-27 17:02:09 +00:00
ivost
3b5826059d * Added GetInterfaceWeak to TObject. It's equal to GetInterface but the returned interface is not referenced. This way it's possible to query interfaces of unreferenced objects.
* Changed fpc_class_as_intf so that it uses GetInterfaceWeak instead of GetInterface. This way it's prevented that the AS operator is increasing the refcounter of an unreferenced object from 0 to 1 temporarily and then by decreasing from 1 to 0 the object is freed.

git-svn-id: trunk@15077 -
2010-03-27 17:00:52 +00:00
paul
1be92bc750 compiler: allow inline static methods + test (moreover static inline was supported)
git-svn-id: trunk@15076 -
2010-03-27 13:40:36 +00:00
Jonas Maebe
a48a37d38b * fixed extended syntax checking {$x-} by moving it from the typecheck pass
to the parser, so that it only looks at what the programmer wrote rather
    than at all statements that the compiler may generate internally
    (mantis #11619)
  + several tests for {$x-} mode
  * modified tenumerators1 so it compiles without extended syntax enabled
    (to check for..in with {$x-})

git-svn-id: trunk@15075 -
2010-03-27 12:51:27 +00:00
Jonas Maebe
d5f415b047 * initialise fwritelocked and freadercount in the TMREWS constructor using
atomic operations so that in case it's created while multiple threads are
    already running, all threads are guaranteed to see this initialisation
  * some minor changes to the comments of TMREWS

git-svn-id: trunk@15074 -
2010-03-27 12:44:51 +00:00
ivost
3f2d66b188 * when calling GetInterfaceByStr on COM Objects, the refcounter was not increased
* this bugfix fixes bugreport #0012778

git-svn-id: trunk@15073 -
2010-03-27 11:12:46 +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
d8a902b4c4 * fixed internalerror in case the from-value of a for-loop has loc_jump
(mantis #15750)

git-svn-id: trunk@15071 -
2010-03-26 22:26:25 +00:00
Jonas Maebe
f0298ad2f5 + test for mantis #15363 fixed in r15066
git-svn-id: trunk@15070 -
2010-03-26 22:12:31 +00:00
Jonas Maebe
4ce7fc92a0 + added pthread_mutex_trylock() to fix compilation after r15026
git-svn-id: trunk@15069 -
2010-03-26 09:45:35 +00:00
ivost
c47c125ec0 * changed 0 to S_OK as return value of QueryInterface (niceness)
* bugfix: initialized temp variables that are going to keep an interface by nil (segfaults)
* bugfix: AS operator has to call QueryInterface before GetInterface (related to revision r15066)

git-svn-id: trunk@15068 -
2010-03-26 00:48:28 +00:00
ivost
f0ce69b264 * added testcase for right behavior of AS and SUPPORTS so that QueryInterface is called before GetInterface
git-svn-id: trunk@15067 -
2010-03-26 00:43:53 +00:00
ivost
8391b717ea * Some (delphi) applications expect that the QueryInterface method is invoked as first priority to query for an interface and GetInterface as 2nd priority
* The changes to the support functions are going to conform that.

git-svn-id: trunk@15066 -
2010-03-26 00:01:52 +00:00
michael
154b30b724 * Fixed parsing of hints in alias types
git-svn-id: trunk@15063 -
2010-03-25 21:32:11 +00:00
michael
332b67ecfb * Removed left-over debug statement
git-svn-id: trunk@15062 -
2010-03-25 20:55:53 +00:00
Jonas Maebe
35941dcae9 * added missing -CO option
git-svn-id: trunk@15056 -
2010-03-25 09:10:41 +00:00
paul
1b614b526a compiler:
- add own symbol table for enumeration to store enumeration elements
  - reimplement enumeration member traverse using symbol table instead of firstenum/nextenum - that members are removed
  - implement TEnum.Element access syntax - element is searched in the enumeration symtable in this case instead of global/local symtables
  - implement {$SCOPEDENUM ON/OFF} local switch
  + tests

git-svn-id: trunk@15051 -
2010-03-25 05:46:53 +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
Jonas Maebe
653974f679 * also give a "potential range error" hint with -CO in case the sizes
match but the source range does not fit in the dest range
    (related to mantis #16023)
  * don't give a "potential range error" when converting between
    s80real and sc80real, since even though the size may differ,
    the represented range does not

git-svn-id: trunk@15044 -
2010-03-24 21:21:19 +00:00
Jonas Maebe
8542632ebe * fixed evaluating constant expressions consisting of more than one term and
that start with a minus in the intel assembler reader (mantis #15843)

git-svn-id: trunk@15041 -
2010-03-24 20:52:31 +00:00
paul
57b67087a8 tests: halt with different error codes for different errors
git-svn-id: trunk@15039 -
2010-03-24 10:36:59 +00:00
joost
520c5fe962 * Since Dwarf 3 the length of a DW_FORM_ref_addr is dependent on the used debug-format (32 or 64 bit), not on the target platform pointer size.
git-svn-id: trunk@15038 -
2010-03-23 12:11:19 +00:00
Jonas Maebe
531efc5a69 * round(x) -> trunc(x+0.5) in Julian date conversion to prevent the current
rounding mode from influencing the result

git-svn-id: trunk@15037 -
2010-03-23 10:34:43 +00:00
paul
1768810783 compiler: allow to derive classes from a nested class type (issue #0016083)
git-svn-id: trunk@15036 -
2010-03-23 05:36:11 +00:00
olivier
8aaa5ee123 The unit name should start with an upper case to pass tobject5.pp test under BeOS (not tested yet ;-).
git-svn-id: trunk@15035 -
2010-03-23 00:24:42 +00:00
olivier
0223697b17 The unit name should start with an upper case to pass tobject5.pp test under Haiku.
git-svn-id: trunk@15034 -
2010-03-23 00:21:55 +00:00
Jonas Maebe
4303eda80c * moved SInvalidJulianDate from rtlconst to sysconst (part of r15032,
necessary because dateutils only depends on sysconst and it contains
    the julian-datetime helper routines)

git-svn-id: trunk@15033 -
2010-03-22 22:28:59 +00:00
Jonas Maebe
82ff623390 + fixed Julian date helpers (based on patch by Bernd Engelhardt, mantis
#16040)
  * finished remaining unimplemented Julian date helpers

git-svn-id: trunk@15032 -
2010-03-22 21:01:46 +00:00
Jonas Maebe
87c9773ac0 + also support & to escape identifiers (and for octal notation) in Delplhi
mode (patch by Blaise Thorn, mantis #15930)

git-svn-id: trunk@15031 -
2010-03-21 23:33:44 +00:00
Jonas Maebe
6db635210a * don't give an internalerror when passing a constant string to an
openstring parameter (mantis #16022)

git-svn-id: trunk@15030 -
2010-03-21 14:51:12 +00:00
marco
3ef5d17209 * run clean_files target also for distclean, fixes cleaning of installer.pas
git-svn-id: trunk@15029 -
2010-03-21 12:49:21 +00:00
marco
3c26eb8186 * fix removing units/$fpctarget dir while cleaning. Probably manual
intervention is needed because deeper level dirs create this unitdir.

git-svn-id: trunk@15028 -
2010-03-21 12:41:42 +00:00
Jonas Maebe
fa1d72a2cc + definition of pthread_mutex_trylock(), fixes compilation after r15026
git-svn-id: trunk@15027 -
2010-03-21 11:47:27 +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
marco
0f9f3600c5 * Disable parts of commit 13378 for windows, since it blocks extracting zips with Unix lineseparators (like Open Office files, even when generated on Windows)
* Minor tweak to demo

git-svn-id: trunk@15025 -
2010-03-21 10:28:29 +00:00
marco
49fc4795e3 * fix for mantis 16052 RFC4122 compliance of own random GUID creation. Part II
git-svn-id: trunk@15024 -
2010-03-20 14:08:10 +00:00