Hello I've got few questions because I'm working on some C library port to GNU GPC. On the assumption that best reasult will be maintained if 1) There will not be any unit file but only original include files with orignal tree structure {$ifndef __NAME__} {$define __NAME__} {$include <sothing.inc>} works perfectly with GPC and also -llibname -L/usr/lib/.... -I/usr/include...... too 2) all macro definitions will be converted to macro definitions NOT to wrpaer functions to avoid not neccesery function jumps in generated code 3) all inlines, functions implemented in interface of headers will be keeped as they are without any new function wrappers all this as mentioned before i did but i found one thing strange for me
Why this don't work : we've got an pointer array inside a redord field
type ppointer = ^pointer; type our_rec = packed record ptr_data : ppointer; end; var some_array : ^our_rec; needed_pointer : pointer;
imagine we got an array of pointers and
some_array^.ptr_data points at this array
when i try to acces elements in that way as it is in C ,freepascal needed_pointer := some_array^.ptr_data[2]^ {3rd element , pointer in array} i got an error something like '...trying to acces an array on somthing is not an array ...' BUT this works needed_pointer := (some_array^.ptr_data+2)^
In GPC manual http://www.gnu-pascal.de/gpc_120.html#SEC120 there is written GPC allows to increment, decrement, compare, and subtract pointers or to use them in `for' loops just like the C language. a: array [1 .. 7] of Char; p, q: ^Char; .......... for p := @A[1]
Isn't nearly the same as my example ? Maybe this is a problem of latest snapshot of gpc i use with GCC 3.2.1 ? 20021128, based on gcc-3.2.1
Second problem I got in C function like that with variable number of arguments type name (arg,arg, ....) so i implemented it as function name (arg;arg; var add_arg_) : type But i can pass only one aditional argument
Is possible to implement variable number of arguments for functions ? Or maybe i have to overload it with 2 or more similar functions ? but the way is function overloading allowed in GNU Gpc ?
3rd Question any ideas how to implement C++ library with classes inside ?
PS: GPC is going to be the best Objective Pascal compiler ....
Sincerelly Artur Bać