[fpc-pascal] Using platform specific include files like FPC does

Tomas Hajny XHajT03 at mbox.vol.cz
Thu May 21 11:27:56 CEST 2009


On Thu, May 21, 2009 10:13, Marco van de Voort wrote:
> In our previous episode, Graeme Geldenhuys said:
>> How do I use platform specific include files like FPC does, but in my
>> own projects?
>
> FPC has actually several schemes.
>
> The most common two are:
>
> 1 {$ifdef'ed} inclusion of includefiles.
> 2 having make set the includedir to a target version.
>
> The first is dead simple, the second depends on your makefile system.
>
> Note that afaik the main reason FPC does this is because too many ifdefs
> make the source unreadable. It is not because of a grudge against ifdefs.

Well, additional advantages of not having IFDEFs in the code (second
scenario) include higher consistency of implementation across the
platforms and no need for changes in the common source when adding support
for new platforms.

Tomas





More information about the fpc-pascal mailing list