MySQL 8.3.0
Source Code Documentation
openssl_version.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2018, 2023, Oracle and/or its affiliates.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License, version 2.0,
6 as published by the Free Software Foundation.
7
8 This program is also distributed with certain software (including
9 but not limited to OpenSSL) that is licensed under separate terms,
10 as designated in a particular file or component or in included license
11 documentation. The authors of MySQL hereby grant you an additional
12 permission to link the program and your derivative works with the
13 separately licensed software that they have included with MySQL.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23*/
24#ifndef ROUTER_OPENSSL_VERSION_INCLUDED
25#define ROUTER_OPENSSL_VERSION_INCLUDED
26
27/**
28 * build openssl version.
29 *
30 * Format
31 * : MNNFFPPS: major minor fix patch status
32 *
33 * major
34 * : 4 bit
35 *
36 * minor
37 * : 8 bit
38 *
39 * fix
40 * : 8 bit
41 *
42 * patch
43 * : 8 bit, 'a' = 0, 'b' = 1, ...
44 *
45 * status
46 * : 4 bit, 0x0 dev, 0xf release, everything else beta
47 *
48 * see https://www.openssl.org/docs/manmaster/man3/OPENSSL_VERSION_NUMBER.html
49 */
50#define ROUTER_OPENSSL_VERSION_FULL(MAJOR, MINOR, FIX, PATCH, STATUS) \
51 (((MAJOR & 0xf) << 28) | ((MINOR & 0xff) << 20) | ((FIX & 0xff) << 12) | \
52 ((PATCH & 0xff) << 4) | (STATUS & 0xf))
53
54/**
55 * build openssl version (pre-releases and stable).
56 *
57 * @see ROTUER_OPENSSL_VERSION_FULL
58 */
59#define ROUTER_OPENSSL_VERSION(MAJOR, MINOR, FIX) \
60 ROUTER_OPENSSL_VERSION_FULL(MAJOR, MINOR, FIX, 0, 0x0)
61
62/**
63 * build openssl version (stable only).
64 *
65 * @see ROTUER_OPENSSL_VERSION_FULL
66 */
67#define ROUTER_OPENSSL_VERSION_STABLE(MAJOR, MINOR, FIX) \
68 ROUTER_OPENSSL_VERSION_FULL(MAJOR, MINOR, FIX, 0, 0xf)
69
70static_assert(ROUTER_OPENSSL_VERSION(1, 2, 3) == 0x10203000L, "failed");
71static_assert(ROUTER_OPENSSL_VERSION(0, 9, 4) == 0x00904000L, "failed");
72static_assert(ROUTER_OPENSSL_VERSION_STABLE(1, 2, 3) == 0x1020300fL, "failed");
73static_assert(ROUTER_OPENSSL_VERSION_STABLE(0, 9, 4) == 0x0090400fL, "failed");
74
75#endif
#define ROUTER_OPENSSL_VERSION(MAJOR, MINOR, FIX)
build openssl version (pre-releases and stable).
Definition: openssl_version.h:59
#define ROUTER_OPENSSL_VERSION_STABLE(MAJOR, MINOR, FIX)
build openssl version (stable only).
Definition: openssl_version.h:67