[fpc-pascal] Trying to convert some C code

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Tue Nov 7 12:31:19 CET 2006


since this is from a c library you should define {$packrecords c} on
the unit with this code.

type
  BIGNUM = bignum_st;

  PBIGNUM = ^bignum_st;

  bignum_st = record
    d: PBN_ULONG;
    top: cint;
    dmax: cint;
    neg: cint;
    flags: cint;
  end;

  TBN_bn2hex = function (const a: PBIGNUM): PChar; cdecl;

  As you can see this code won't compile, you need to also find the
declaration of BN_ULONG and define it. Also put ctypes on the uses
clause.

-- 
Felipe Monteiro de Carvalho



More information about the fpc-pascal mailing list