]> git.ipfire.org Git - thirdparty/openssl.git/blame - include/openssl/opensslv.h.in
Fix typo in CONTRIBUTING.md
[thirdparty/openssl.git] / include / openssl / opensslv.h.in
CommitLineData
21dcbebc 1/*
f3866324
RL
2 * {- join("\n * ", @autowarntext) -}
3 *
454afd98 4 * Copyright 1999-2020 The OpenSSL Project Authors. All Rights Reserved.
21dcbebc 5 *
48f4ad77 6 * Licensed under the Apache License 2.0 (the "License"). You may not use
21dcbebc
RS
7 * this file except in compliance with the License. You can obtain a copy
8 * in the file LICENSE in the source distribution or at
9 * https://www.openssl.org/source/license.html
10 */
11
ae4186b0
DMSP
12#ifndef OPENSSL_OPENSSLV_H
13# define OPENSSL_OPENSSLV_H
d86167ec
DMSP
14# pragma once
15
3a63dbef 16# ifdef __cplusplus
17e80c6b 17extern "C" {
3a63dbef
RL
18# endif
19
20/*
21 * SECTION 1: VERSION DATA. These will change for each release
e90c7729 22 */
3a63dbef
RL
23
24/*
25 * Base version macros
b436a982 26 *
3a63dbef
RL
27 * These macros express version number MAJOR.MINOR.PATCH exactly
28 */
f3866324
RL
29# define OPENSSL_VERSION_MAJOR {- $config{major} -}
30# define OPENSSL_VERSION_MINOR {- $config{minor} -}
31# define OPENSSL_VERSION_PATCH {- $config{patch} -}
3a63dbef
RL
32
33/*
26b7cc0d 34 * Additional version information
b436a982 35 *
3a63dbef
RL
36 * These are also part of the new version scheme, but aren't part
37 * of the version number itself.
38 */
39
40/* Could be: #define OPENSSL_VERSION_PRE_RELEASE "-alpha.1" */
26b7cc0d 41# define OPENSSL_VERSION_PRE_RELEASE "{- $config{prerelease} -}"
3a63dbef
RL
42/* Could be: #define OPENSSL_VERSION_BUILD_METADATA "+fips" */
43/* Could be: #define OPENSSL_VERSION_BUILD_METADATA "+vendor.1" */
f3866324 44# define OPENSSL_VERSION_BUILD_METADATA "{- $config{build_metadata} -}"
3a63dbef
RL
45
46/*
26b7cc0d
RL
47 * Note: The OpenSSL Project will never define OPENSSL_VERSION_BUILD_METADATA
48 * to be anything but the empty string. Its use is entirely reserved for
49 * others
3a63dbef
RL
50 */
51
3a63dbef
RL
52/*
53 * Shared library version
b436a982 54 *
3a63dbef
RL
55 * This is strictly to express ABI version, which may or may not
56 * be related to the API version expressed with the macros above.
57 * This is defined in free form.
58 */
f3866324 59# define OPENSSL_SHLIB_VERSION {- $config{shlib_version} -}
3a63dbef
RL
60
61/*
26b7cc0d 62 * SECTION 2: USEFUL MACROS
3a63dbef
RL
63 */
64
65/* For checking general API compatibility when preprocessing */
66# define OPENSSL_VERSION_PREREQ(maj,min) \
bf5b04ea 67 ((OPENSSL_VERSION_MAJOR << 16) + OPENSSL_VERSION_MINOR >= ((maj) << 16) + (min))
3a63dbef 68
3a63dbef
RL
69/*
70 * Macros to get the version in easily digested string form, both the short
71 * "MAJOR.MINOR.PATCH" variant (where MAJOR, MINOR and PATCH are replaced
72 * with the values from the corresponding OPENSSL_VERSION_ macros) and the
73 * longer variant with OPENSSL_VERSION_PRE_RELEASE_STR and
74 * OPENSSL_VERSION_BUILD_METADATA_STR appended.
75 */
f3866324
RL
76# define OPENSSL_VERSION_STR "{- $config{version} -}"
77# define OPENSSL_FULL_VERSION_STR "{- $config{full_version} -}"
3a63dbef
RL
78
79/*
80 * SECTION 3: ADDITIONAL METADATA
f3866324
RL
81 *
82 * These strings are defined separately to allow them to be parsable.
3a63dbef 83 */
f3866324 84# define OPENSSL_RELEASE_DATE "{- $config{release_date} -}"
3a63dbef
RL
85
86/*
d6e9ddac 87 * SECTION 4: BACKWARD COMPATIBILITY
b436a982 88 */
26b7cc0d
RL
89
90# define OPENSSL_VERSION_TEXT "OpenSSL {- "$config{full_version} $config{release_date}" -}"
91
3a63dbef 92/* Synthesize OPENSSL_VERSION_NUMBER with the layout 0xMNN00PPSL */
7e8c3381 93# ifdef OPENSSL_VERSION_PRE_RELEASE
500a7615 94# define _OPENSSL_VERSION_PRE_RELEASE 0x0L
7e8c3381 95# else
500a7615 96# define _OPENSSL_VERSION_PRE_RELEASE 0xfL
3a63dbef 97# endif
7e8c3381
VD
98# define OPENSSL_VERSION_NUMBER \
99 ( (OPENSSL_VERSION_MAJOR<<28) \
100 |(OPENSSL_VERSION_MINOR<<20) \
101 |(OPENSSL_VERSION_PATCH<<4) \
102 |_OPENSSL_VERSION_PRE_RELEASE )
b436a982 103
3a63dbef 104# ifdef __cplusplus
17e80c6b 105}
3a63dbef 106# endif
285a0db3
RL
107
108# include <openssl/macros.h>
109# ifndef OPENSSL_NO_DEPRECATED_3_0
110# define HEADER_OPENSSLV_H
111# endif
112
ae4186b0 113#endif /* OPENSSL_OPENSSLV_H */