MGL(Win32)
読み取り中…
検索中…
一致する文字列を見つけられません
mgl_version.h
[詳解]
1// SPDX-License-Identifier: Zlib
2/* ------------------------------------------------------------------------- */
9/* ------------------------------------------------------------------------- */
10
11#ifndef INCGUARD_MGL_VERSION_H_1606555397
12#define INCGUARD_MGL_VERSION_H_1606555397
13
14#include <cstdint>
15
17#define MGL_MAKE_VERSION(major, minor, patch) \
18 ((major) * 10000000 + (minor) * 10000 + (patch))
19
20#define MGL_MAJOR_VERSION 1
21#define MGL_MINOR_VERSION 1
22#define MGL_PATCH_VERSION 13
23
25#define MGL_CURRENT_VERSION \
26 MGL_MAKE_VERSION(MGL_MAJOR_VERSION, MGL_MINOR_VERSION, MGL_PATCH_VERSION)
27
28namespace MGL
29{
30constexpr uint32_t kMajorVersion = MGL_MAJOR_VERSION;
31constexpr uint32_t kMinorVersion = MGL_MINOR_VERSION;
32constexpr uint32_t kPatchVersion = MGL_PATCH_VERSION;
33
34
35/* ------------------------------------------------------------------------- */
43/* ------------------------------------------------------------------------- */
44constexpr uint32_t MakeVersion(uint32_t major, uint32_t minor, uint32_t patch) noexcept
45{
46 return major * 10000000 + minor * 10000 + patch;
47}
48
50constexpr uint32_t kCurrentVersion = MakeVersion(kMajorVersion, kMinorVersion, kPatchVersion);
51
52/* ------------------------------------------------------------------------- */
61/* ------------------------------------------------------------------------- */
62constexpr bool IsALater(uint32_t major, uint32_t minor = 0, uint32_t patch = 0) noexcept
63{
64 return MakeVersion(major, minor, patch) >= kCurrentVersion;
65}
66}
67
68#endif // INCGUARD_MGL_VERSION_H_1606555397
69
70// vim: et ts=4 sw=4 sts=4
constexpr uint32_t kCurrentVersion
現在のバージョン
Definition mgl_version.h:50
constexpr bool IsALater(uint32_t major, uint32_t minor=0, uint32_t patch=0) noexcept
特定のバージョン以降かを取得
Definition mgl_version.h:62
#define MGL_MAJOR_VERSION
メジャーバージョン
Definition mgl_version.h:20
constexpr uint32_t kPatchVersion
パッチバージョン
Definition mgl_version.h:32
constexpr uint32_t kMinorVersion
マイナーバージョン
Definition mgl_version.h:31
#define MGL_PATCH_VERSION
パッチバージョン
Definition mgl_version.h:22
#define MGL_MINOR_VERSION
マイナーバージョン
Definition mgl_version.h:21
constexpr uint32_t kMajorVersion
メジャーバージョン
Definition mgl_version.h:30
constexpr uint32_t MakeVersion(uint32_t major, uint32_t minor, uint32_t patch) noexcept
バージョン値の生成
Definition mgl_version.h:44