[fpc-devel] ctypes and RTL

Ivo Steinmann ivo_steinmann at gmx.net
Mon Sep 15 11:06:52 CEST 2008


Marco van de Voort schrieb:
> In our previous episode, Florian Klaempfl said:
>   
>> Ivo Steinmann schrieb:
>>     
>>> no problem,
>>> size_t stuff reverted (was a commit around r11752)
>>>
>>> I maintain my translated headers on my own svn server, it's simpler for me.
>>>       
>> Writing code satisfying everybody's need is indeed not easy :)
>>     
>
> Yup. The current situation took nearly a year (first renamings in may,
> finished with FPC_USE_LIBC in week between christmas and newyear)
>   
yes, and that's exactly the code looks like. not clearly structured (at 
least concerning ctypes.inc and ptypes.inc and the alias include files 
required for keeping it consistent). my changes are so small. for the 
users itself there's almost no change, except that they have to use 
UnixType unit also now, but that could be avoided by merging unixtype 
with baseunix and then dropping unixtype. If really somebody uses 
unixtype, they simply remove it from uses clause. in 99% of all cases 
unixtype is used together with baseunix.

if somebody want to use a c-type, then include ctypes into uses. in 
current situation you can simply include baseunix, then you have got 
your ctypes also. but then be consequent and add ctypes to windows unit 
also (and other oses). now for one os you have to use ctypes, for the 
other not -- really nice one.

same for unixtype, baseunix and unix... all these 3 units define the 
same types (while unixtype is the master, and baseunix and unix uses an 
alias include to it). what's the idea having 3 units defining the same 
types? why not making a clear situation and say:
1. unixtype defines all unixtypes and baseunix some base functionalty
or
2. let's drop unixtype and therefore baseunix defines all base types and 
functionality.

for me it simply looks messy and dont tell me this was planned from 
beginning. nobody plans such a code structure. there were changes over a 
long time and this was the result.


BTW: my branch is linux only so far, for other oses an update of 
Makefile.fpc and some small changes in units are required.

-Ivo



More information about the fpc-devel mailing list