[fpc-pascal] Help converting h-file

Jonas Maebe jonas.maebe at elis.ugent.be
Sun Sep 7 16:00:44 CEST 2008


On 07 Sep 2008, at 14:35, Koenraad Lelong wrote:

> Google helped me understand the "volatile" keyword, but is there a
> Pascal alternative ?

No. FPC is at this time unlikely to perform any optimisations on  
pointer or global variables accesses that would be inhibited by making  
them "volatile" though.

> The "static inline" is more difficult to understand.

Just declare them as regular functions (with or without inline). It's  
C's way of doing cross-module inlining:
a) the code has to be available in the header file, so the C compiler  
has the C code available to inline when the function is called
b) if you declare the same function more than once, you are going to  
get multiple symbols with the same name and these will clash at link  
time. Therefore such inline functions in headers (which are almost  
always included in more than one source file) have to be declared  
static, as this makes these symbols private to that particular file.


Jonas



More information about the fpc-pascal mailing list