[fpc-pascal] TFPCHeapStatus miscalculations in 2.3.1

2009-08-11 Thread Seth Grover
I haven't logged a bug because I haven't yet figured out the steps to exactly reproduce this, but I've been seeing something strange since I've started using 2.3.1. I have a thread pool in my application which gets assigned to run a "job" by the user, does so, and then waits until it's called on a

[fpc-pascal] Re: TFPCHeapStatus miscalculations in 2.3.1

2009-08-11 Thread Seth Grover
Actually I was able to distill it down into a smaller example: program Project1; {$mode objfpc}{$H+} uses Classes, SysUtils; function RandomRange(const low : longint; const high : longint) : longint; begin if (high < low)

Re: [fpc-pascal] Re: TFPCHeapStatus miscalculations in 2.3.1

2009-08-11 Thread Vincent Snijders
Seth Grover schreef: Actually I was able to distill it down into a smaller example: randomize(); For reproducebility, can you change it to RandSeed := (some *constant* you choose); Vincent ___ fpc

[fpc-pascal] Set of encoding conversion routines

2009-08-11 Thread Felipe Monteiro de Carvalho
Hello, Does anyone know if there is a set of encoding conversion routines? If there isn't, how should we add one? New directory in fpc/packages? I just needed UTF-8 to Latin 1 ISO but I can't find a cross-platform solution. Remembering that UTF8ToAnsi doesn't solve the problem because it converts

Re: [fpc-pascal] Set of encoding conversion routines

2009-08-11 Thread Marco van de Voort
In our previous episode, Felipe Monteiro de Carvalho said: > > Does anyone know if there is a set of encoding conversion routines? If > there isn't, how should we add one? New directory in fpc/packages? Cross platform, with a library? The lowest level is unit charset in the rtl, Unix style iconv

Re: [fpc-pascal] Set of encoding conversion routines

2009-08-11 Thread Zaher Dirkey
There is unit in Lazarus lcl\LConvEncoding.pas is that you mean? -- Zaher Dirkey ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Set of encoding conversion routines

2009-08-11 Thread theo
I just needed UTF-8 to Latin 1 ISO but I can't find a cross-platform solution. Remembering that UTF8ToAnsi doesn't solve the problem because it converts to the system encoding and not Latin 1 ISO. A simpe option might be: wides:=UTF8Decode(utf8s); widestringmanager.Wide2AnsiMoveProc:=...@

Re: [fpc-pascal] Set of encoding conversion routines

2009-08-11 Thread Marco van de Voort
In our previous episode, Zaher Dirkey said: > There is unit in Lazarus > lcl\LConvEncoding.pas > is that you mean? yes. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

[fpc-pascal] Dynamic loading shared libraries

2009-08-11 Thread theo
Am I right, that with fpc it is only possible to write bindings for dynamically loading shared libraries (using LoadLibrary) the hard way? Meaning declare function like: init_alloc_root : procedure(root: PMEM_ROOT;block_size : Cardinal);extdecl; and then using GetProcedureAddress like: point

Re: [fpc-pascal] Dynamic loading shared libraries

2009-08-11 Thread Jonas Maebe
On 11 Aug 2009, at 21:18, theo wrote: Am I right, that with fpc it is only possible to write bindings for dynamically loading shared libraries (using LoadLibrary) the hard way? Meaning declare function like: init_alloc_root : procedure(root: PMEM_ROOT;block_size : Cardinal);extdecl;and

Re: [fpc-pascal] Dynamic loading shared libraries

2009-08-11 Thread Jonas Maebe
On 11 Aug 2009, at 21:25, Jonas Maebe wrote: On 11 Aug 2009, at 21:18, theo wrote: Does h2pas have an option for this? -p Sorry, -P Jonas ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/

Re: [fpc-pascal] Dynamic loading shared libraries

2009-08-11 Thread theo
How would the easy way be? I've just been looking into some old Kylix sources: interface const LibName = ''; function XftDrawCreate(display: PDisplay; win: XID; vis: PVisual; colorm: longint): PXftDraw; cdecl; implementation function XftDrawCreate(display: PDisplay; win: XID; vis: PVisual

Re: [fpc-pascal] Dynamic loading shared libraries

2009-08-11 Thread Florian Klaempfl
theo schrieb: > >> How would the easy way be? >> > > I've just been looking into some old Kylix sources: > > interface > const LibName = ''; > function XftDrawCreate(display: PDisplay; win: XID; vis: PVisual; > colorm: longint): PXftDraw; cdecl; > > implementation > function XftDrawCreate(displ

Re: [fpc-pascal] Dynamic loading shared libraries

2009-08-11 Thread theo
Yes, this was possible with Kylix, however, it requires the usage of PIC also inside the caller. Thanks for the information. It's good to know about the h2pas option. I was not aware of it. In the many options --help show, it is described as -P use proc. vars for impo

Re: [fpc-pascal] Dynamic loading shared libraries

2009-08-11 Thread leledumbo
> I was looking for something like "dynamic" http://www.freepascal.org/docs-html/user/usersu84.html http://www.freepascal.org/docs-html/user/usersu84.html -- View this message in context: http://www.nabble.com/Dynamic-loading-shared-libraries-tp24924047p24929903.html Sent from the Free Pascal -