next up previous contents index
Next: Generic Macro Keywords Up: The Macro Preprocessor Previous: The Macro Preprocessor   Contents   Index


Predefined Macros

The macro preprocessor defines several macro names that are common to all instances of the preprocessor and apply in all cases where the preprocessor is in use. These names are the same in all cases, they do not differ with different file types. The predefined macro names can not be undefined or set to a different value, attempts to do so will trigger an error. These are the following:

RELEASE
First implemented: release 3.0.5
The macro name RELEASE is predefined to the release number code. The release number code is a five digit integer xyzz0, corresponding to release x.y.z. The x (always 3) and y are one digit fields, zz is a two-digit field, 0 padded. The trailing 0 is a historical anachronism. For example, for release 3.2.5, the macro is predefined to ``32050''.

GENERATION
First implemented: release 4.1.10
This is set to the generation part of the release triplet, which is ``4'' for the current generation 4.

MAJOR
First implemented: release 4.1.10
This is set to the middle number of the release triplet, for example for release 4.1.10, MAJOR is set to ``1''.

MINOR
First implemented: release 4.1.10
This is set to the rightmost number or the release triplet, for example for release 4.1.10, MINOR is set to ``10''.

OSNAME
First implemented: release 4.2.12
This is set to the distribution name of the program, for example ``LinuxCentos7''.

OSTYPE
First implemented: release 3.2.19
This macro name is set to one of the following words, depending on the operating system target of the running program. Note that this is determined at compile time, so is static in the program binary, and may not be the ``real'' operating system if running under an emulator. For example, a Linux binary running under FreeBSD would still indicate ``Linux''.

Distribution Target Keyword
Any Linux ``Linux''
Windows ``Windows''
FreeBSD ``UNIX''
Any Apple ``OSX''

OSBITS
First implemented: release 3.2.19
This macro is set to either ``32'' or ``64'', depending on whether the program was compiled for 32- or 64-bit memory addresses. This is determined at compile time, so that a 32-bit binary running on a 64-bit operating system would indicate ``32''.

XTROOT
First implemented: release 3.2.19
This macro is defined to be the system xictools installation location path as assumed by the running program. It reflects the status of environment variables or other means of defining this path, and will revert to a default. This directory is typically ``/usr/local/xictools'' in non-Windows programs. The Windows path is similar but may include a drive specifier and use back instead of forward slash separators.

PROGROOT
First implemented: release 3.3.1
This macro is defined to be the system installation location path for the running program as assumed by the running program. It reflects the status of environment variables or other means of defining this path, and will revert to a default. For example, this directory is typically
[4]``/usr/local/xictools/xic'' for the Xic program, in non-Windows programs. The Windows path is similar but may include a drive specifier and use back instead of forward slash separators.

product name
First implemented: release 3.0.5
In releases prior to 4.0.9, exactly one of the macro names ``Xic'', ``XicII'', or ``Xiv'' would be defined, depending upon which of the programs was being run. The name is not defined to any text, but one can test whether or not a given name is defined. In release 4.0.9 and later, the separate XicII and Xiv programs were discontinued, but the functionality lives on as feature sets of Xic. The Xic symbol is always defined when running Xic for any feature set, and is therefor rather useless but provides some backward compatibility.

This macro has the property that instances of the macro are not replaced (with an empty string) when macro-expanding, i.e., macro substitution is inhibited (4.2.12 and later).

feature set name
First implemented: release 4.0.9
The macro ``FEATURESET'' will be defined to one of three strings, depending upon the feature set running. If all features are enabled, the string is "FULL". If the XicII (EDITOR) permission set is running, the string is "EDITOR". If the Xiv (VIEWER) feature set is running, the string is "VIEWER". The macro can be tested with forms similar to
If FEATURESET == "FULL"
...
Endif

technology name
First implemented: release 3.2.18
If the technology file uses the Technology keyword to define a name for the technology, that name will be predefined as a macro name. The name is not defined to any text, but one may test whether or not a given name is defined.

This macro has the property that instances of the macro are not replaced (with an empty string) when macro-expanding, i.e., macro substitution is inhibited (4.2.12 and later).

These macros are always available, and additional predefined macros may be available in the various contexts, which are documented elsewhere.

technology definitions
First implemented: release 4.3.10
In addition to above, if the technology file uses the Technology keyword to define a name for the technology, the predefined macro ``TECHNOLOGY'' is set to that name. Furthermore, if the Vendoor keyword is used to define a name, the ``VENDOR'' predefined macro is set to the name. Similarly, Process can be used to assign a name to the predefined ``PROCESS'' macro.


next up previous contents index
Next: Generic Macro Keywords Up: The Macro Preprocessor Previous: The Macro Preprocessor   Contents   Index
Stephen R. Whiteley 2022-05-28