[fpc-pascal] Re: Runs correctly when debugging.

Guillermo Martínez Jiménez gmartinez at burdjia.com
Tue May 8 12:52:14 CEST 2012

> From: Henry Vermaak
> Subject: Re: [fpc-pascal] Re: Runs correctly when debugging.
> It's hard to say without seeing your function/type declarations.

Actually I don't call the function that raises the SIGSEGV signal,
since it's an internal function.  Allegro has a "driver" struct
(RECORD) that stores a pointer to this function only if OpenGL is used
(else it uses DirectX or something like that), then functions that
uses or modifies the "bitmap" struct uses it.

For example, it's used by next function:

  ALLEGRO_BITMAP *al_load_bitmap(const char *filename);

The wrapper I wrote is:

  (* Abstract type representing a bitmap (2D image). *)

  FUNCTION al_load_bitmap (CONST filename: STRING): ALLEGRO_BITMAPptr; CDECL;

I'm concerning about the "STRING" type as it may affect the stack (I
had problems with enumerations because FPC optimised them and C
doesn't) and use "PCHAR" instead, but manual says it's not a problem
if using "-h" or "{$LONGSTRINGS ON}".

More information about the fpc-pascal mailing list