Skip to content
FutureBlitz

    Install

    Import std.core.version

    std.core.version

    FB_VERSION, the version of fb that built the program, and its three numbers.

    They're Consts, for code and Const expressions, and not #If symbols, so #If can't choose by them. They're there from fb 1.4.0 on, so a library that must build with an older fb can't name them. Each release of fb writes its own version here, which its build refuses to differ from what fb --version says, and fb refuses a std whose version isn't its own; a build of fb between releases says the last release's version, as fb --version does.

    FB_VERSION is the version of the fb that compiled the code that uses it, so a prebuilt library's own compiled Functions and Consts have the library's, and what's compiled with the program (generics, @Inline and Const Functions, default arguments) has the program's.

    Examples

    Expect(FB_VERSION == "{FB_VERSION_MAJOR}.{FB_VERSION_MINOR}.{FB_VERSION_PATCH}")

    std/core/version.fb

    Constants and globals

    FB_VERSION const

    Public Const FB_VERSION = "1.5.0"

    The version of fb that built the program, as fb --version says it, like "1.5.0".

    std/core/version.fb, line 20

    FB_VERSION_MAJOR const

    Public Const FB_VERSION_MAJOR = 1

    FB_VERSION's first number, which a change that breaks programs raises.

    std/core/version.fb, line 23

    FB_VERSION_MINOR const

    Public Const FB_VERSION_MINOR = 5

    FB_VERSION's second number, which an addition raises.

    std/core/version.fb, line 26

    FB_VERSION_PATCH const

    Public Const FB_VERSION_PATCH = 0

    FB_VERSION's third number, which a fix raises.

    std/core/version.fb, line 29

    Report an issue with this page or with FutureBlitz on GitHub.