xref: /libuv/docs/src/version.rst (revision c072a384)
1
2.. _version:
3
4Version-checking macros and functions
5=====================================
6
7Starting with version 1.0.0 libuv follows the `semantic versioning`_
8scheme. This means that new APIs can be introduced throughout the lifetime of
9a major release. In this section you'll find all macros and functions that
10will allow you to write or compile code conditionally, in order to work with
11multiple libuv versions.
12
13.. _semantic versioning: https://semver.org
14
15
16Macros
17------
18
19.. c:macro:: UV_VERSION_MAJOR
20
21    libuv version's major number.
22
23.. c:macro:: UV_VERSION_MINOR
24
25    libuv version's minor number.
26
27.. c:macro:: UV_VERSION_PATCH
28
29    libuv version's patch number.
30
31.. c:macro:: UV_VERSION_IS_RELEASE
32
33    Set to 1 to indicate a release version of libuv, 0 for a development
34    snapshot.
35
36.. c:macro:: UV_VERSION_SUFFIX
37
38    libuv version suffix. Certain development releases such as Release Candidates
39    might have a suffix such as "rc".
40
41.. c:macro:: UV_VERSION_HEX
42
43    Returns the libuv version packed into a single integer. 8 bits are used for
44    each component, with the patch number stored in the 8 least significant
45    bits. E.g. for libuv 1.2.3 this would be 0x010203.
46
47    .. versionadded:: 1.7.0
48
49
50Functions
51---------
52
53.. c:function:: unsigned int uv_version(void)
54
55    Returns :c:macro:`UV_VERSION_HEX`.
56
57.. c:function:: const char* uv_version_string(void)
58
59    Returns the libuv version number as a string. For non-release versions the
60    version suffix is included.
61