[fpc-pascal] undocumented 'library' hint directive

Marco van de Voort marcov at stack.nl
Tue Oct 13 15:30:54 CEST 2015


In our previous episode, Graeme Geldenhuys said:
> Based on the latest FPC Language Reference documentation, there is no
> "library" hint directive (like Delphi & Kylix has)...
> 
> Yet the following example program compiles without error using FPC
> 2.6.4. I gather this is an omission in the documentation?
> 
> Second question, what does the "library" hint directive mean or do?


http://docwiki.embarcadero.com/RADStudio/Seattle/en/Declarations_and_Statements

A lot of the later ones were added in one go, not all might be implemented.
Seems it is only meant to flag functions as potentially os dependent,
similar to platform.

Another such one is experimental.

Quote from above link:

Use platform to mark items that are specific to a particular operating
environment (such as Windows), deprecated to indicate that an item is
obsolete or supported only for backward compatibility, and library to flag
dependencies on a particular library or component framework.

(MvdV: read: VCL vs CLX)

The Delphi compiler also recognizes the hinting directive experimental. You
can use this directive to designate units that are in an unstable
development state. The compiler will emit a warning when it builds an
application that uses the unit. 



More information about the fpc-pascal mailing list