Re: [fpc-pascal] Question about functions returning a string

2014-12-27 Thread Dan
On Nov 29, 2014 3:55 AM, Ewald ew...@yellowcouch.org wrote: Hi, Take the following function prototype (in {$mode objfpc}{$H+} for the record): Function SomeFunction(const Data: PChar; const Len: LongWord): String; cdecl; public; Looking at the dissasembly of this function, I see that

Re: [fpc-pascal] Question about functions returning a string

2014-12-01 Thread Ewald
On 12/01/2014 04:34 AM, leledumbo wrote: So in general, one should not use managed types in the prototype of an exported (public) function? Bingo. At least not until we have properly sharable RTL. The problem lies not with a sharable RTL. As mentioned, I do not want to /use/ these managed

Re: [fpc-pascal] Question about functions returning a string

2014-11-30 Thread Ewald
On 11/29/2014 02:46 PM, Sven Barth wrote: In general managed types (which a (Ansi)String is) are passed as parameters. That is very interesting knowledge. Thanks! So in general, one should not use managed types in the prototype of an exported (public) function? While I do know that the other

Re: [fpc-pascal] Question about functions returning a string

2014-11-30 Thread leledumbo
So in general, one should not use managed types in the prototype of an exported (public) function? Bingo. At least not until we have properly sharable RTL. my thought was that it would be possible to pass along these managed types (especially string, as it is a pointer internally) to another

Re: [fpc-pascal] Question about functions returning a string

2014-11-29 Thread Ewald
On 11/29/2014 12:41 AM, Flávio Etrusco wrote: Are you sure it's not the result that is passed in the first parameter? http://en.wikipedia.org/wiki/X86_calling_conventions#cdecl Good question, but I don't think so. The first few lines of assembly from this function seem to read three arguments

Re: [fpc-pascal] Question about functions returning a string

2014-11-29 Thread Sven Barth
On 29.11.2014 13:56, Ewald wrote: On 11/29/2014 12:41 AM, Flávio Etrusco wrote: Are you sure it's not the result that is passed in the first parameter? http://en.wikipedia.org/wiki/X86_calling_conventions#cdecl Good question, but I don't think so. The first few lines of assembly from this

Re: [fpc-pascal] Question about functions returning a string

2014-11-28 Thread Flávio Etrusco
On Fri, Nov 28, 2014 at 5:54 PM, Ewald ew...@yellowcouch.org wrote: Hi, Take the following function prototype (in {$mode objfpc}{$H+} for the record): Function SomeFunction(const Data: PChar; const Len: LongWord): String; cdecl; public; Looking at the dissasembly of this function, I