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

Guillermo Martínez Jiménez gmartinez at burdjia.com
Thu May 10 14:44:41 CEST 2012


> No, you have to use pchar.  I would also define ALLEGRO_BITMAP as an
> empty record, to be clear that it's an opaque type:
>
> {$packrecords c}
>  TAllegroBitmap = record
>  end;
>  PAllegroBitmap = ^TAllegroBitmap;
>
> Thus:
>
> function al_load_bitmap(const filename: pchar): PAllegroBitmap; cdecl;
> external ALLEGRO_LIB_NAME;
>
> Make sure you use {$packrecords c}.  Use the types in unit "ctypes",
> e.g. cint, cfloat, cdouble.  This will ensure the variables are the same
> size and work on all architectures.
>
> Henry

Ok, then I should revise all the "STRING" parameters, as well as all
pointer types and "ctypes".

Thanks for the advices.
Guillermo.



More information about the fpc-pascal mailing list