Unit ok_include_environment

Uses
Classes, Interfaces, Objects and Records
Functions and Procedures
Types
Variables

Description

Test of handling the "$I or $INCLUDE : Include compiler info" feature of FPC, see [http://www.freepascal.org/docs-html/prog/progsu38.html].

PasDoc bug spotted by Michalis on 2005-12-04 when trying `make htmldocs' on fpc compiler sources, in file version.pas.

Notes about how it should be implemented in PasDoc :

PasDoc will not expand these macros. Instead PasDoc will just explicitly show that e.g. value of MacDATE is %DATE%, value of MacFPCTARGET is %FPCTARGET% etc. Reasons:

Overview

Constants

MacDATE = {$I %DATE%};
MacFPCTARGET = {$I %FPCTARGET%};
MacFPCTARGETCPU = {$I %FPCTARGETCPU%};
MacFPCTARGETOS = {$I %FPCTARGETOS%};
MacFPCVERSION = {$I %FPCVERSION%};
MacFILE = {$I %FILE%};
MacLINE = {$I %LINE%};
MacTIME = {$I %TIME%};
MacUSEREnv = {$I %USER%};
MacPathEnv = {$I %PATH%};

Description

Constants

MacDATE = {$I %DATE%};

Inserts the current date.

MacFPCTARGET = {$I %FPCTARGET%};

Inserts the target CPU name. (deprecated, use FPCTARGETCPU)

MacFPCTARGETCPU = {$I %FPCTARGETCPU%};

Inserts the target CPU name.

MacFPCTARGETOS = {$I %FPCTARGETOS%};

Inserts the target OS name.

MacFPCVERSION = {$I %FPCVERSION%};

Current compiler version number.

MacFILE = {$I %FILE%};

Filename in which the directive is found.

MacLINE = {$I %LINE%};

Linenumer on which the directive is found.

MacTIME = {$I %TIME%};

Current time.

MacUSEREnv = {$I %USER%};

If xxx inside %xxx% is none of the above, then it is assumed to be the name of an environment variable. Its value will be fetched.

MacPathEnv = {$I %PATH%};