MySQL 9.1.0
Source Code Documentation
openssl_version.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2018, 2024, 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 designed to work 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 either included with
14 the program or referenced in the documentation.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24*/
25#ifndef ROUTER_OPENSSL_VERSION_INCLUDED
26#define ROUTER_OPENSSL_VERSION_INCLUDED
27
28/**
29 * build openssl version.
30 *
31 * Format
32 * : MNNFFPPS: major minor fix patch status
33 *
34 * major
35 * : 4 bit
36 *
37 * minor
38 * : 8 bit
39 *
40 * fix
41 * : 8 bit
42 *
43 * patch
44 * : 8 bit, 'a' = 0, 'b' = 1, ...
45 *
46 * status
47 * : 4 bit, 0x0 dev, 0xf release, everything else beta
48 *
49 * see https://www.openssl.org/docs/manmaster/man3/OPENSSL_VERSION_NUMBER.html
50 */
51#define ROUTER_OPENSSL_VERSION_FULL(MAJOR, MINOR, FIX, PATCH, STATUS) \
52 (((MAJOR & 0xf) << 28) | ((MINOR & 0xff) << 20) | ((FIX & 0xff) << 12) | \
53 ((PATCH & 0xff) << 4) | (STATUS & 0xf))
54
55/**
56 * build openssl version (pre-releases and stable).
57 *
58 * @see ROTUER_OPENSSL_VERSION_FULL
59 */
60#define ROUTER_OPENSSL_VERSION(MAJOR, MINOR, FIX) \
61 ROUTER_OPENSSL_VERSION_FULL(MAJOR, MINOR, FIX, 0, 0x0)
62
63/**
64 * build openssl version (stable only).
65 *
66 * @see ROTUER_OPENSSL_VERSION_FULL
67 */
68#define ROUTER_OPENSSL_VERSION_STABLE(MAJOR, MINOR, FIX) \
69 ROUTER_OPENSSL_VERSION_FULL(MAJOR, MINOR, FIX, 0, 0xf)
70
71static_assert(ROUTER_OPENSSL_VERSION(1, 2, 3) == 0x10203000L, "failed");
72static_assert(ROUTER_OPENSSL_VERSION(0, 9, 4) == 0x00904000L, "failed");
73static_assert(ROUTER_OPENSSL_VERSION_STABLE(1, 2, 3) == 0x1020300fL, "failed");
74static_assert(ROUTER_OPENSSL_VERSION_STABLE(0, 9, 4) == 0x0090400fL, "failed");
75
76#endif
#define ROUTER_OPENSSL_VERSION(MAJOR, MINOR, FIX)
build openssl version (pre-releases and stable).
Definition: openssl_version.h:60
#define ROUTER_OPENSSL_VERSION_STABLE(MAJOR, MINOR, FIX)
build openssl version (stable only).
Definition: openssl_version.h:68