Re: [fpc-devel] Free Pascal

2014-03-06 Thread Žilvinas Ledas

Hi,

I would be interested to hear your method as I have some code I would 
like to potentially be able to use on Windows Phone 8.



Thanks,
Žilvinas


On 2014-03-05 20:18, Vsevolod Alekseyev wrote:

Hi Sergio,

I say your message on the Free Pascal mailing list: 
http://lists.freepascal.org/lists/fpc-devel/2014-January/033140.html


I have recently succeeeded in porting a rather large algorithm library 
written in Delphi to Windows Phone, via Free Pascal. Depending on the 
specifics of your project, my approach might help. Let me know if 
you're still interested.


Regards,
Seva Alekseyev

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel



___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] Free Pascal

2014-03-06 Thread Žilvinas Ledas


On 2014-03-06 10:51, Tomas Hajny wrote:

On Thu, March 6, 2014 09:13, Žilvinas Ledas wrote:


Hi Žilvinas,


I would be interested to hear your method as I have some code I would
like to potentially be able to use on Windows Phone 8.

Please note that the original poster is not subscribed to fpc-devel (at
least not under the account used for sending his e-mail) and he may thus
not see your response.


Thanks Tomas, I wrote now a private message as well!


Žilvinas
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] estimating function code size

2012-01-18 Thread Žilvinas Ledas


On 2012-01-18 15:08, Gennadiy Poryev wrote:

Do you think it's granted that there is only one return in a function ?
Maybe optimization or exit could create additional returns

Actually I do. Because I write this function :)
It uses quite a lot of loops and ifs, but no exits.
And what I need is a reliable way to get its code size at runtime without 
manually inspecting it on every rebuild.


I had similar problem a year and a half ago. I ended up looking for 
ret using disassembler.


Regarding one ret per function, I got this response from Jonas at that time:

On 2010-07-18 15:42, Jonas Maebe wrote:

On 18 Jul 2010, at 13:14, Žilvinas Ledas wrote:


I want to use it this way:
1) Gel all @unitname.function addresses.
2) Use disassembler to find nearest next RET.
3) Then I assume that I have start and end of the function in the binary file.

It works at least for the concept-showing app with some functions and enabled 
optimizations when compiling. Do I have some conceptual flaw?

Yes: there is no guarantee that a function will contain only one ret (it is 
that way currently for compiler-generated code, but that can change at any time).


Jonas


___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] Compilation is broken at rev. 17482 ?

2011-05-17 Thread Žilvinas Ledas

Hello all,
is it me, or compilation is broken (revision: 17482):

...
Fatal: Can't find unit fphttpclient used by pkgfphttp
Fatal: Compilation aborted
make[4]: *** [pkgfphttp.ppu] Error 1
make[4]: Leaving directory 
`E:/lazarus/fpc/fpc_my/source_SVN___/packages/fppkg'

make[3]: *** [fpc_smart] Error 2
make[3]: Leaving directory 
`E:/lazarus/fpc/fpc_my/source_SVN___/packages/fppkg'

make[2]: *** [fppkg_smart] Error 2
make[2]: Leaving directory `E:/lazarus/fpc/fpc_my/source_SVN___/packages'
make[1]: *** [packages_smart] Error 2
make[1]: Leaving directory `E:/lazarus/fpc/fpc_my/source_SVN___'
make: *** [build-stamp.i386-win32] Error 2



Regards
Žilvinas
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Compilation is broken at rev. 17482 ?

2011-05-17 Thread Žilvinas Ledas



On 2011-05-17 20:36, Michael Van Canneyt wrote:


Please update packages/Makefile* and try again. I added a dependency 
of fppkg on fcl-web


Michael.

Thank you, it works now.


Regards
Žilvinas
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] HTTP client/server components committed.

2011-05-15 Thread Žilvinas Ledas

Hi,
it's greate fpc has simple http client now ;)

On 2011-05-15 19:13, Michael Van Canneyt wrote:


if someone knows where this file can be found (or related information) 
on a Windows OS, please let me know.


You can look at components\turbopower_ipro\iputils.pas - it has handling 
for mime types. MSWindows ifdef has a good code for Windows OS (line 
2751, function GetLocalContent(const TheFileName: string): string;).



Regards,
Zilvinas
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel]Building compiler, rtl, host, target... (cross compiling)

2011-04-06 Thread Žilvinas Ledas

Hi,
maybe some basic info could help you understand some things: 
http://wiki.lazarus.freepascal.org/Cross_compiling


Regards
Žilvinas

On 2011-04-06 23:19, Skybuck Flying wrote:

Hello,


...


Bye,
 Skybuck.


___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Boehm garbage collector for freepascal

2010-11-19 Thread Žilvinas Ledas

It works, but there is a small problem: the compiler itself is a
nightmare for any heap manager and it shows*THE*  disadvantages of GC:
it is sloow.
Compiling the system unit with the default heap manager:
0.4 sec
with the BoehmGC port
98.9 sec (creates a ppu, but crashes on exit)

Nice! I had such a feeling, so it was more like hypothetical proposal ;)


Regards
Zilvinas Ledas
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Boehm garbage collector for freepascal

2010-11-18 Thread Žilvinas Ledas
But it might be an advantage for some projects as the discussions over 
the years implied. 
What about using GC for fpc itself? If it is usable for fpc, then the 
problem of fpc leaking memory when compilation fails with errors can be 
solved using GC. As a result fpc can be integrated to some IDEs without 
a fear or memleaks.

Just a thought.

Regards
Zilvinas Ledas
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] RIP NoGlobals

2010-09-30 Thread Žilvinas Ledas


On 2010-09-30 12:57, Jonas Maebe wrote:
Mantis does not keep information about the evolution of that over 
time, but you can always look at the current average at 
http://bugs.freepascal.org/summary_page.php (under Time Stats For 
Resolved Issues (days)). 


Not all of us have rights to access these pages. I get:
---
Access Denied.
[ Click here to proceed ]
---


Regards
Žilvinas Ledas
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Status of Delphi-like packages (Class+RTTI aware DLL/SO)?

2010-09-09 Thread Žilvinas Ledas

 On 2010-09-09 12:23, Willibald Krenn wrote:

Hi!

Please forgive my ignorance on this topic, but I'd like to know whether someone 
is working on adding Delphi-like packages to FPC. (At least for the 
windows/linux platforms.) Somehow the lack of this feature always has stopped 
me from using fpc/lazarus: For a change, I am thinking of contributing to the 
efforts unless - of course - the feature's already in the works :).

Cheers,
  Willi

P.S.: Way back in time, I did some investigation on the Delphi (6) name 
mangling, see http://edn.embarcadero.com/article/27758 (german only).


Hi,
I think you can start by reading http://wiki.freepascal.org/packages and 
http://wiki.freepascal.org/shared_library .


Regards
Žilvinas Ledas
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] [patch] pscanner: differentiate between EOL Tab characters from general Whitespace

2010-08-28 Thread Žilvinas Ledas



On 2010-08-28 01:38, Graeme Geldenhuys wrote:

Yes, I placed in on GitHub. You can clone the repository as follows:

via git protocol (faster):
 git clone git://github.com/graemeg/fpprofiler.git

via http protocol:
 git clone http://github.com/graemeg/fpprofiler.git


Alternatively (though not tested) - you should be able to download a
zip archive of the latest code via this URL:
http://github.com/graemeg/fpprofiler/zipball/HEAD


NOTE:
Make sure the code you want to profile is backed up, or in some
repository. I have found cases where the profiler (fpp) failed to
modify all units due to parsing errors, then failed again restoring
all units to what they were. I think I fixed this bug, but I thought I
better let you know
Thank you - I will try it today or tomorrow. I will write if I'll find 
some bugs.



Regards
Žilvinas
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] [patch] pscanner: differentiate between EOL Tab characters from general Whitespace

2010-08-28 Thread Žilvinas Ledas


On 2010-08-28 01:38, Graeme Geldenhuys wrote:


Alternatively (though not tested) - you should be able to download a
zip archive of the latest code via this URL:
http://github.com/graemeg/fpprofiler/zipball/HEAD

Tried sample project today. Some a comment and a question:
1) I have a strange error when the same file is modified twice (and 
afterwards restored twice). One is:
insert: E:\lazarus\components\fpprofiler\demo\test001\test001.pp 
.. OK

and another is:
insert: .\test001.pp
 - After these two modifications modified units have compilation errors 
(duplicate uses units).

 - When modifications are removed - duplicate files are deleted totally.
 - (BTW, when -r is used for fpp it is passed to fpc and fpc is not happy.)
 - I am attaching console output if it helps at all.
 - I used a workaround:
In procedure InsertProfilingCode(FileList: TStrings; ModTokenProc: 
TModTokenProc);

-
  //make a copy of the original files and process them
  for i := 0 to FileList.Count - 1 do
  begin
if FileExists(FileList[i] + FPPROF_EXT) then begin  // -- if the 
file is processed (backup exists) - do not process it again
  writer.AddIgnoredFile(FileList[i]);  // -- (don't know if this 
is required?)

  Continue; // --
end; // --
-
In procedure RemoveProfilingCodeFromFile(const FileName: string);
-
begin
  if FileExists(FileName) then begin  // -- if there is no backup file 
- do not delete original file

-

2) Where should I write comments/bug reports for fpprofiler?


Regards
Žilvinas
E:\lazarus\components\fpprofiler\demo\test001fpp -r test001.pp  -MObjFPC -Scghi
 -O1 -gl -vewnhi -l -FuE:\lazarus\components\fpprofiler\fpprof\ -Fu. -FUlib\i386
-win32\ -oproject1.exe
GNU FreePascal profiler 0.2
Copyright 2007 Darius Blaszyk. Contributions by Graeme Geldenhuys 2010.
FPP is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
There is absolutely no warranty for FPP.

insert: E:\lazarus\components\fpprofiler\demo\test001\test001.pp .. OK
insert: E:\lazarus\components\fpprofiler\demo\test001\test_001.pas .. OK

insert: E:\lazarus\components\fpprofiler\fpprof\fpmake.inc .. OK
insert: E:\lazarus\components\fpprofiler\fpprof\fpmake.pp .. OK
insert: E:\lazarus\components\fpprofiler\fpprof\fpprof.pp .. OK
insert: E:\lazarus\components\fpprofiler\fpprof\fpputils.pas .. OK
insert: E:\lazarus\components\fpprofiler\fpprof\fppwriter.pas .. OK
insert: E:\lazarus\components\fpprofiler\fpprof\systemtime.inc .. OK
insert: E:\lazarus\components\fpprofiler\fpprof\win32systemtime.inc .. O
K
insert: .\test001.ppinsert: .\test_001.pasexecuting: fpc -gl -FuE:\lazarus\compo
nents\fpprofiler\fpprof -r test001.pp -MObjFPC -Scghi -O1 -gl -vewnhi -l -FuE:\l
azarus\components\fpprofiler\fpprof\ -Fu. -FUlib\i386-win32\ -oproject1.exe

Hint: Start of reading config file E:\lazarus\fpc\fpc_my\bin\i386-win32\fpc.cfg
Hint: End of reading config file E:\lazarus\fpc\fpc_my\bin\i386-win32\fpc.cfg
Error: Illegal parameter: -r
Hint: -? writes help pages
Error: E:\lazarus\fpc\fpc_my\bin\i386-win32\ppc386.exe returned an error exitcod
e (normal if you did not specify a source file to be compiled)___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] [patch] pscanner: differentiate between EOL Tab characters from general Whitespace

2010-08-28 Thread Žilvinas Ledas

 P. S. I know I didn't have to include
-FuE:\lazarus\components\fpprofiler\fpprof\
This log is from an experiment...


___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] [patch] pscanner: differentiate between EOL Tab characters from general Whitespace

2010-08-27 Thread Žilvinas Ledas


On 2010-08-26 17:24, Graeme Geldenhuys wrote:

I'll find it a new home tomorrow and post the link


Any news? ;)


Regards
Žilvinas
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] [patch] pscanner: differentiate between EOL Tab characters from general Whitespace

2010-08-26 Thread Žilvinas Ledas


On 2010-08-22 16:42, Graeme Geldenhuys wrote:

fpprofiler (it was a bit further along than my own attempt), but it
wasn't touched for over 2 years, so didn't compile. It was also
riddled with memory leaks (sorry Darius Blaszyk). I fixed a lot of
things including memory leaks, removed the custom parser to rather use
the one included in FCL etc..


Sorry for OT, but where can I find fpprofiler? I didn't manage to find 
svn link to it (some links google gave me were broken...).

Even better would be to have your updated/improved profiler.


Thanks
Žilvinas
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] [patch] pscanner: differentiate between EOL Tab characters from general Whitespace

2010-08-26 Thread Žilvinas Ledas



On 2010-08-26 17:24, Graeme Geldenhuys wrote:

Op 2010-08-26 16:20, Žilvinas Ledas het geskryf:

It's in the 'fpcprojects' repository.
http://svn.freepascal.org/svn/fpcprojects/fpprofiler


Thanks, I'll try it.

Just remember, that's not going to compile.


Yes, I understand that.

Please, post a link to it when you have it. I am definately interested
in it!

I'll find it a new home tomorrow and post the link.


If you will do it tomorrow then I will wait for it ;)
BTW, what is required/preffered version of fpc? I didn't updated it in a 
few months (2010/06/09) so I guess I should get an update to use your 
improved version of fpprofiler?



Regards
Žilvinas
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] How to get function start and end position in executable?

2010-07-16 Thread Žilvinas Ledas

Hello all,

I want to implement kind of executable protection using software 
guards (*) - when function (caller) decrypts another function (callee) 
before calling it and encrypts it again after callee returns.
As a result I need to get addresses of my functions (where the asm code 
starts and ends in the executable). Is there some way to export such 
info to external file while fpc compiles executable (or maybe afterwards 
to get this info from executable)?

Any suggenstions would be appreciated!

(*) J. Cappaert, N. Kisserli, D. Schellekens, B. Preneel. 
Self-encrypting Code to Protect Against Analysis and Tampering, 2006 
(https://www.cosic.esat.kuleuven.be/publications/article-811.pdf)



Regards
Žilvinas Ledas
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] FPC doesn't support big equations

2010-03-31 Thread Žilvinas Ledas


I need the result of big mathematical expression but apparently FPC 
cannot process it. I've made a simple test program in C and was able 
to get the correct value. In FPC it gives Invalid floating point 
operation, tested in Windows7 (64bit) with FPC 2.2.4 (32 bit) and 
Ubuntu 9.10 (32bit) with FPC 2.2.4 (32 bit).


http://rapidshare.com/files/370437049/TestFunc.pas
http://rapidshare.com/files/370436993/TestFunc.c

It works for me using FPC from SVN (~7 days old) on Win7. The printed 
result is: -7.96011734923075E+001.

I guess you need to update your FPC.


Regards,
Žilvinas Ledas
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] Profiling in Windows

2009-12-06 Thread Žilvinas Ledas

Hello all,

I have downloaded and installed cygwin (1,7) under windows 7.
I have put 
C:\cygwin\lib\;C:\cygwin\bin\;C:\cygwin\lib\gcc\i686-pc-cygwin\3.4.4\ 
with -Fl option and I am trying to compile my program with -pg (using 
Lazarus IDE), but I'm getting this error:


sint_LPC.lpr(311,1) Error: Failed reading coff file, invalid section 
index while reading C:\cygwin\lib\libcygwin.a(_cygwin_crt0_common.o)


What am I doing wrong?


Regards,
Žilvinas Ledas


JoshyFun wrote:

Hello Vincent,

Friday, November 20, 2009, 8:30:49 AM, you wrote:

  

pp.pas(224,1) Error: Import library not found for c
pp.pas(224,1) Error: Import library not found for gmon
pp.pas(224,1) Error: Import library not found for cygwin
pp.pas(224,1) Error: Import library not found for user32
pp.pas(224,1) Error: Import library not found for kernel32
pp.pas(224,1) Error: Import library not found for gcc
  

VS I have those files in c:\cygwin\lib. I don't know anymore what cygwin 
packages I
VS installed to get them.
VS Last time I tried (a couple of months ago), I could compile Lazarus with 
profiling
VS info, but the gprof output file remained empty, IIRC.

I had used it one year ago for a project and I had to install mingw32
and cygwin and add the libs paths to the other library of the
project. This is my search path for that project, maybe it helps:

C:\cygwin\bin\;C:\cygwin\lib\;C:\Mingw\lib\;C:\Mingw\lib\gcc\mingw32\3.4.5\

Obviously one of them is not needed ;)

  


___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Errors using generics - what is wrong?

2009-10-07 Thread Žilvinas Ledas
Yes, I had an internal error and now I know why - I used specialization 
in function params. This gives internal error:

procedure asdasd(something: specialize TTwoValuesListUnicodeString);
begin
end;

I'll make a bug report tomorow or a day after.

And yes, I think a descriptive message saying to use typed 
specialization would be nice for those using generics first time.



Regards,
Zilvinas



Tomas Hajny wrote:

On Wed, October 7, 2009 18:47, Micha Nelissen wrote:
  

Tomas Hajny wrote:


Well, the internal error is in any case a bug, so if this appears also
with the latest (trunk) version, a bug report would be useful.
  

I didn't see an internal error? But a more descriptive message would be
useful ('specialization not allowed in this context' or so?).



The original post mentioned Fatal: Internal error 200204175.

Tomas
  

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] Errors using generics - what is wrong?

2009-10-06 Thread Žilvinas Ledas

Hello all,

I am trying to use generics but compilation fails.
Whan I try to use unit with my generic class in my real project I get 
Fatal: Internal error 200204175 error.

When I try to use it in empty Lazarus application (Unit1.pas) and I put
-
procedure TForm1.Button1Click(Sender: TObject);
var
 lst:  specialize TTwoValuesListUnicodeString;
begin
end;
-
I get these errors:
-
Unit1.pas(29,17) Error: Forward declaration not solved constructor 
TTwoValuesList$UnicodeString.Create;
Unit1.pas(30,16) Error: Forward declaration not solved destructor 
TTwoValuesList$UnicodeString.Destroy;
Unit1.pas(32,15) Error: Forward declaration not solved 
TTwoValuesList$UnicodeString.AddString(UnicodeString,UnicodeString);
Unit1.pas(33,14) Error: Forward declaration not solved 
TTwoValuesList$UnicodeString.GetS1(LongInt):UnicodeString;
Unit1.pas(34,14) Error: Forward declaration not solved 
TTwoValuesList$UnicodeString.GetS2(LongInt):UnicodeString;
Unit1.pas(35,14) Error: Forward declaration not solved 
TTwoValuesList$UnicodeString.Count:LongInt;
Unit1.pas(36,14) Error: Forward declaration not solved 
TTwoValuesList$UnicodeString.GetS2(UnicodeString,Boolean=FALSE):UnicodeString;

Unit1.pas(47) Fatal: There were 7 errors compiling module, stopping
-

my generic class is in another (not Unit1.pas) unit looks like this:
-
type
 generic TTwoValuesListTVal = class
 type private
   PTwoVal = ^TTwoVal;
   TTwoval = record
 FS1: TVal;
 FS2: TVal;
   end;

 var private
   FLst: TFPList;

 public
   constructor Create;
   destructor Destroy;

   procedure AddString(S1: TVal; S2: TVal);
   function GetS1(i: Integer): TVal;
   function GetS2(i: Integer): TVal; overload;
   function Count: Integer;
   function GetS2(S1: TVal; isSorted: Boolean = false): TVal; overload;

 published
   property Items: TFPList read FLst;

 end;
-

What am I doing wrong?


Regards,
Zilvinas Ledas
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Errors using generics - what is wrong?

2009-10-06 Thread Žilvinas Ledas

Sorry, I forgot to mention I am using
Free Pascal Compiler version 2.3.1 [2009/09/08] for i386
(don't know how to get more specific version info...)



Žilvinas Ledas wrote:

Hello all,

I am trying to use generics but compilation fails.
Whan I try to use unit with my generic class in my real project I get 
Fatal: Internal error 200204175 error.

When I try to use it in empty Lazarus application (Unit1.pas) and I put
-
procedure TForm1.Button1Click(Sender: TObject);
var
 lst:  specialize TTwoValuesListUnicodeString;
begin
end;
-
I get these errors:
-
Unit1.pas(29,17) Error: Forward declaration not solved constructor 
TTwoValuesList$UnicodeString.Create;
Unit1.pas(30,16) Error: Forward declaration not solved destructor 
TTwoValuesList$UnicodeString.Destroy;
Unit1.pas(32,15) Error: Forward declaration not solved 
TTwoValuesList$UnicodeString.AddString(UnicodeString,UnicodeString);
Unit1.pas(33,14) Error: Forward declaration not solved 
TTwoValuesList$UnicodeString.GetS1(LongInt):UnicodeString;
Unit1.pas(34,14) Error: Forward declaration not solved 
TTwoValuesList$UnicodeString.GetS2(LongInt):UnicodeString;
Unit1.pas(35,14) Error: Forward declaration not solved 
TTwoValuesList$UnicodeString.Count:LongInt;
Unit1.pas(36,14) Error: Forward declaration not solved 
TTwoValuesList$UnicodeString.GetS2(UnicodeString,Boolean=FALSE):UnicodeString; 


Unit1.pas(47) Fatal: There were 7 errors compiling module, stopping
-

my generic class is in another (not Unit1.pas) unit looks like this:
-
type
 generic TTwoValuesListTVal = class
 type private
   PTwoVal = ^TTwoVal;
   TTwoval = record
 FS1: TVal;
 FS2: TVal;
   end;

 var private
   FLst: TFPList;

 public
   constructor Create;
   destructor Destroy;

   procedure AddString(S1: TVal; S2: TVal);
   function GetS1(i: Integer): TVal;
   function GetS2(i: Integer): TVal; overload;
   function Count: Integer;
   function GetS2(S1: TVal; isSorted: Boolean = false): TVal; overload;

 published
   property Items: TFPList read FLst;

 end;
-

What am I doing wrong?


Regards,
Zilvinas Ledas
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Errors using generics - what is wrong?

2009-10-06 Thread Žilvinas Ledas

Vincent Snijders wrote:


I would try to use a named type:
type
  TTwoUnicodeValuesList = specialize TTwoValuesListUnicodeString;

procedure TForm1.Button1Click(Sender: TObject);
var
 lst:  TTwoUnicodeValuesList;
begin
end;

Vincent



Thanks, it works with named type.
Is using not named specializations is some kind of not implemented yet 
part? :)



Regards
Zlvinas Ledas
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel