Re: [fpc-devel] gtkliststore.inc

2008-01-22 Thread Michael Van Canneyt


On Tue, 22 Jan 2008, Paul Ishenin wrote:

 Hello,  FPC developers' list.
 
 Can someone tell me what for gtk2 package have this strange defines inside
 sources:
 
 {$IFNDEF KYLIX}
 function gtk_list_store_new(n_columns:gint; args:array of
 const):PGtkListStore; cdecl; overload; external gtklib;
 function gtk_list_store_new(n_columns:gint):PGtkListStore; cdecl; overload;
 varargs; external gtklib;
 {$ELSE}
 function gtk_list_store_new(n_columns:gint):PGtkListStore; varargs; cdecl;
 external gtklib;
 {$ENDIF}
 
 I am about KYLIX.

the problem is the ...) construct in C; in FPC this used to be translated by 
array of const, but Kylix uses the varargs; modifier.

now, for FPC you should also use varargs, so the correct form is
 function gtk_list_store_new(n_columns:gint):PGtkListStore; varargs; cdecl; 
external gtklib;
both for FPC and Kylix.

Michael.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] gtkliststore.inc

2008-01-22 Thread Michael Van Canneyt


On Tue, 22 Jan 2008, Paul Ishenin wrote:

 Michael Van Canneyt wrote:
  
  On Tue, 22 Jan 2008, Paul Ishenin wrote:
  
   Hello,  FPC developers' list.
  
   Can someone tell me what for gtk2 package have this strange defines inside
   sources:
  
   {$IFNDEF KYLIX}
   function gtk_list_store_new(n_columns:gint; args:array of
   const):PGtkListStore; cdecl; overload; external gtklib;
   function gtk_list_store_new(n_columns:gint):PGtkListStore; cdecl;
   overload;
   varargs; external gtklib;
   {$ELSE}
   function gtk_list_store_new(n_columns:gint):PGtkListStore; varargs; cdecl;
   external gtklib;
   {$ENDIF}
  
   I am about KYLIX.
  
  the problem is the ...) construct in C; in FPC this used to be translated by
  array of const, but Kylix uses the varargs; modifier.
  
  now, for FPC you should also use varargs, so the correct form is
  function gtk_list_store_new(n_columns:gint):PGtkListStore; varargs; cdecl;
  external gtklib;
  both for FPC and Kylix.
 
 
 How can I use varargs if in fpc svn functions are declared with array of cont?

You cannot.

 
 Btw, returning to gtk2 package. Sources of that package are very old - they
 used only gtk 2.0 functions, structures and constants. 2.2, 2.4, 2.6, 2.8,
 2.10 and 2.12 versions were already released. Ofcource I understand that most
 of users still not using gtk 2.12, but at least gtk 2.4 can be taken as
 minimal requirement.

Feel free to update the sources. None of the FPC devels has time for this.
As far as I remember the GTK 2 sources were donated.

Michael.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] gtkliststore.inc

2008-01-22 Thread Paul Ishenin

Michael Van Canneyt wrote:


On Tue, 22 Jan 2008, Paul Ishenin wrote:


Hello,  FPC developers' list.

Can someone tell me what for gtk2 package have this strange defines inside
sources:

{$IFNDEF KYLIX}
function gtk_list_store_new(n_columns:gint; args:array of
const):PGtkListStore; cdecl; overload; external gtklib;
function gtk_list_store_new(n_columns:gint):PGtkListStore; cdecl; overload;
varargs; external gtklib;
{$ELSE}
function gtk_list_store_new(n_columns:gint):PGtkListStore; varargs; cdecl;
external gtklib;
{$ENDIF}

I am about KYLIX.


the problem is the ...) construct in C; in FPC this used to be translated by 
array of const, but Kylix uses the varargs; modifier.


now, for FPC you should also use varargs, so the correct form is
 function gtk_list_store_new(n_columns:gint):PGtkListStore; varargs; cdecl; 
external gtklib;
both for FPC and Kylix.



How can I use varargs if in fpc svn functions are declared with array of 
cont?


Btw, returning to gtk2 package. Sources of that package are very old - 
they used only gtk 2.0 functions, structures and constants. 2.2, 2.4, 
2.6, 2.8, 2.10 and 2.12 versions were already released. Ofcource I 
understand that most of users still not using gtk 2.12, but at least gtk 
2.4 can be taken as minimal requirement.


Best regards,
Paul Ishenin.

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


[fpc-devel] gtkliststore.inc

2008-01-21 Thread Paul Ishenin

Hello,  FPC developers' list.

Can someone tell me what for gtk2 package have this strange defines 
inside sources:


{$IFNDEF KYLIX}
function gtk_list_store_new(n_columns:gint; args:array of 
const):PGtkListStore; cdecl; overload; external gtklib;
function gtk_list_store_new(n_columns:gint):PGtkListStore; cdecl; 
overload; varargs; external gtklib;

{$ELSE}
function gtk_list_store_new(n_columns:gint):PGtkListStore; varargs; 
cdecl; external gtklib;

{$ENDIF}

I am about KYLIX.


--
Best regards,
Paul Ishenin.

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel