opensslconf.h.in 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. /*
  2. * {- join("\n * ", @autowarntext) -}
  3. *
  4. * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
  5. *
  6. * Licensed under the OpenSSL license (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. #include <openssl/opensslv.h>
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #ifdef OPENSSL_ALGORITHM_DEFINES
  16. # error OPENSSL_ALGORITHM_DEFINES no longer supported
  17. #endif
  18. /*
  19. * OpenSSL was configured with the following options:
  20. */
  21. {- if (@{$config{openssl_sys_defines}}) {
  22. foreach (@{$config{openssl_sys_defines}}) {
  23. $OUT .= "#ifndef $_\n";
  24. $OUT .= "# define $_ 1\n";
  25. $OUT .= "#endif\n";
  26. }
  27. }
  28. foreach (@{$config{openssl_api_defines}}) {
  29. (my $macro, my $value) = $_ =~ /^(.*?)=(.*?)$/;
  30. $OUT .= "#define $macro $value\n";
  31. }
  32. if (@{$config{openssl_algorithm_defines}}) {
  33. foreach (@{$config{openssl_algorithm_defines}}) {
  34. $OUT .= "#ifndef $_\n";
  35. $OUT .= "# define $_\n";
  36. $OUT .= "#endif\n";
  37. }
  38. }
  39. if (@{$config{openssl_thread_defines}}) {
  40. foreach (@{$config{openssl_thread_defines}}) {
  41. $OUT .= "#ifndef $_\n";
  42. $OUT .= "# define $_\n";
  43. $OUT .= "#endif\n";
  44. }
  45. }
  46. if (@{$config{openssl_other_defines}}) {
  47. foreach (@{$config{openssl_other_defines}}) {
  48. $OUT .= "#ifndef $_\n";
  49. $OUT .= "# define $_\n";
  50. $OUT .= "#endif\n";
  51. }
  52. }
  53. "";
  54. -}
  55. /*
  56. * Sometimes OPENSSSL_NO_xxx ends up with an empty file and some compilers
  57. * don't like that. This will hopefully silence them.
  58. */
  59. #define NON_EMPTY_TRANSLATION_UNIT static void *dummy = &dummy;
  60. /*
  61. * Applications should use -DOPENSSL_API_COMPAT=<version> to suppress the
  62. * declarations of functions deprecated in or before <version>. Otherwise, they
  63. * still won't see them if the library has been built to disable deprecated
  64. * functions.
  65. */
  66. #ifndef DECLARE_DEPRECATED
  67. # define DECLARE_DEPRECATED(f) f;
  68. # ifdef __GNUC__
  69. # if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0)
  70. # undef DECLARE_DEPRECATED
  71. # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated));
  72. # endif
  73. # elif defined(__SUNPRO_C)
  74. # if (__SUNPRO_C >= 0x5130)
  75. # undef DECLARE_DEPRECATED
  76. # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated));
  77. # endif
  78. # endif
  79. #endif
  80. #ifndef OPENSSL_FILE
  81. # ifdef OPENSSL_NO_FILENAMES
  82. # define OPENSSL_FILE ""
  83. # define OPENSSL_LINE 0
  84. # else
  85. # define OPENSSL_FILE __FILE__
  86. # define OPENSSL_LINE __LINE__
  87. # endif
  88. #endif
  89. #ifndef OPENSSL_MIN_API
  90. # define OPENSSL_MIN_API 0
  91. #endif
  92. #if !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < OPENSSL_MIN_API
  93. # undef OPENSSL_API_COMPAT
  94. # define OPENSSL_API_COMPAT OPENSSL_MIN_API
  95. #endif
  96. /*
  97. * Do not deprecate things to be deprecated in version 1.2.0 before the
  98. * OpenSSL version number matches.
  99. */
  100. #if OPENSSL_VERSION_NUMBER < 0x10200000L
  101. # define DEPRECATEDIN_1_2_0(f) f;
  102. #elif OPENSSL_API_COMPAT < 0x10200000L
  103. # define DEPRECATEDIN_1_2_0(f) DECLARE_DEPRECATED(f)
  104. #else
  105. # define DEPRECATEDIN_1_2_0(f)
  106. #endif
  107. #if OPENSSL_API_COMPAT < 0x10100000L
  108. # define DEPRECATEDIN_1_1_0(f) DECLARE_DEPRECATED(f)
  109. #else
  110. # define DEPRECATEDIN_1_1_0(f)
  111. #endif
  112. #if OPENSSL_API_COMPAT < 0x10000000L
  113. # define DEPRECATEDIN_1_0_0(f) DECLARE_DEPRECATED(f)
  114. #else
  115. # define DEPRECATEDIN_1_0_0(f)
  116. #endif
  117. #if OPENSSL_API_COMPAT < 0x00908000L
  118. # define DEPRECATEDIN_0_9_8(f) DECLARE_DEPRECATED(f)
  119. #else
  120. # define DEPRECATEDIN_0_9_8(f)
  121. #endif
  122. /* Generate 80386 code? */
  123. {- $config{processor} eq "386" ? "#define" : "#undef" -} I386_ONLY
  124. #undef OPENSSL_UNISTD
  125. #define OPENSSL_UNISTD {- $target{unistd} -}
  126. {- $config{export_var_as_fn} ? "#define" : "#undef" -} OPENSSL_EXPORT_VAR_AS_FUNCTION
  127. /*
  128. * The following are cipher-specific, but are part of the public API.
  129. */
  130. #if !defined(OPENSSL_SYS_UEFI)
  131. {- $config{bn_ll} ? "# define" : "# undef" -} BN_LLONG
  132. /* Only one for the following should be defined */
  133. {- $config{b64l} ? "# define" : "# undef" -} SIXTY_FOUR_BIT_LONG
  134. {- $config{b64} ? "# define" : "# undef" -} SIXTY_FOUR_BIT
  135. {- $config{b32} ? "# define" : "# undef" -} THIRTY_TWO_BIT
  136. #endif
  137. #define RC4_INT {- $config{rc4_int} -}
  138. #ifdef __cplusplus
  139. }
  140. #endif