opensslv.h.in 3.3 KB

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