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