[fpc-pascal] header translation question: I need an int sized boolean

Bernd prof7bit at googlemail.com
Sun Apr 22 01:54:17 CEST 2012


Hi,

I have this from the GLIB heads:

typedef int    gint;
typedef gint   gboolean;

Now I need a few packed records with such gboolean types in them. On
my i386 I am now just using

type
  GBoolean = LongBool;

Just to get something┬╣ up and running before the day was over.
Unfortunately I cannot yet test this on 64 bit and I'm not a C
programmer also. I assume on 64 bit architectures the int will be 64
bit, is this correct? I haven't found anything in the ctypes unit,
should I use ifdefs to define my GBoolean or is there a more elegant
one-liner to easily get such an integer sized bool?

Bernd

_______
┬╣ I am trying to find out whether I can make a libpurple (Pidgin)
plugin in FPC without needing these headers and gcc at all and without
jumping through too many hoops. Now I have it loading, registering and
unloading without a crash already :-) its not as complicated as I
initially assumed.



More information about the fpc-pascal mailing list