[fpc-devel] ctypes and RTL

Marco van de Voort marcov at stack.nl
Sun Sep 14 22:03:36 CEST 2008


In our previous episode, Ivo Steinmann said:
> I messed a littlebit around with size_t and ctypes. Now I thought it's 
> best to fix all the ctypes stuff in RTL. All that code is quite 
> complicated and hard to maintain. To solve this, I created a new branch 
> for the RTL
> 
> http://svn.freepascal.org/svn/fpc/branches/ctypes/rtl
> 
> the branch solves this problems:
> * ctypes is seperated from the rest of the RTL now, no mess with include 
> files
> * ctypes.pp contains all the c-types now (nothing more)
> * ctypes.pp may include a platform dependant ctypes.inc (if required!)
> * baseunix, unixtype and unix no longer define ctypes (they were 
> included of ptypes.inc)
> * unixtype is seperated now from baseunix and unix
> 
> + the advantage is, that there's a clear structure
> - the disadvantage is, that you have to include ctypes and unixtype into 
> several packages (fixed in most cases)

That breaks compatability, and is the main reason why the current situation
is as it is. To avoid telling people ten times a day "but you must also
include xxxx".

> A discussion in #fpc between me, Florian and Marco resultet in the idea 
> to define a
> csize_t, pcsize_t in ctypes.pp (size_t = csize_t). Since you can define 
> a csize_t per platform, this is a good solution.

I never saw the need to fix this. Or at least I didn't understand it.



More information about the fpc-devel mailing list