libghostty-vt 0.0.0
Loading...
Searching...
No Matches
Version

Check which version of libghostty-vt you are using. More...

Detailed Description

Check which version of libghostty-vt you are using.

libghostty-vt has two versions you may care about: the version of the headers your program compiled against, and the version of the library it loads when it runs.

The macros here describe the headers. ghostty_version() and ghostty_build_info() report the library. These are usually the same. They can differ when a program compiled against one release runs on a system with another release installed. That matters most before 1.0, when any minor release may change the ABI.

Example

// Stop the build if the headers are older than this program needs.
#if !GHOSTTY_VT_VERSION_AT_LEAST(0, 1, 0)
#error "libghostty-vt 0.1.0 or newer is required"
#endif

Full program: c-vt-build-info/src/main.c

See Stability for what each release may break, and Checking the Version for how to check the library when your program starts.

Macros

#define GHOSTTY_VT_VERSION_MAJOR   0
#define GHOSTTY_VT_VERSION_MINOR   1
#define GHOSTTY_VT_VERSION_PATCH   0
#define GHOSTTY_VT_VERSION   "0.1.0"
#define GHOSTTY_VT_VERSION_AT_LEAST(maj, min, pat)

Macro Definition Documentation

◆ GHOSTTY_VT_VERSION

#define GHOSTTY_VT_VERSION   "0.1.0"

The version of the libghostty-vt headers as a string, such as "0.1.0".

This is always three numbers separated by dots. It never has a pre-release or build suffix such as "-dev". Use ghostty_version() for the full version of the library.

Builds made between releases use the number of the release they are working towards. For example, a development build before 0.2.0 sets GHOSTTY_VT_VERSION to "0.2.0", while ghostty_version() returns the full version, such as "0.2.0-dev+abc1234".

The CMake package and the pkg-config file installed with libghostty-vt carry the same version, and are the easiest way to check it from a build system. This header contains only macros and includes no other files, so a build system can also read it directly.

Examples
c-vt-build-info/src/main.c.

Definition at line 60 of file version.h.

◆ GHOSTTY_VT_VERSION_AT_LEAST

#define GHOSTTY_VT_VERSION_AT_LEAST ( maj,
min,
pat )
Value:
(GHOSTTY_VT_VERSION_MAJOR == (maj) && \
(GHOSTTY_VT_VERSION_MINOR == (min) && \
#define GHOSTTY_VT_VERSION_MAJOR
Definition version.h:35
#define GHOSTTY_VT_VERSION_MINOR
Definition version.h:38
#define GHOSTTY_VT_VERSION_PATCH
Definition version.h:41

True if the headers are version maj.min.pat or newer.

This works in #if directives as well as in regular code:

#if GHOSTTY_VT_VERSION_AT_LEAST(0, 2, 0)
// Code that uses functions added in 0.2.0.
#endif
Parameters
majThe major version to compare against
minThe minor version to compare against
patThe patch version to compare against

Definition at line 77 of file version.h.

◆ GHOSTTY_VT_VERSION_MAJOR

#define GHOSTTY_VT_VERSION_MAJOR   0

The major version of the libghostty-vt headers.

Examples
c-vt-build-info/src/main.c.

Definition at line 35 of file version.h.

◆ GHOSTTY_VT_VERSION_MINOR

#define GHOSTTY_VT_VERSION_MINOR   1

The minor version of the libghostty-vt headers.

Examples
c-vt-build-info/src/main.c.

Definition at line 38 of file version.h.

◆ GHOSTTY_VT_VERSION_PATCH

#define GHOSTTY_VT_VERSION_PATCH   0

The patch version of the libghostty-vt headers.

Definition at line 41 of file version.h.