opensslconf.h.in 3.8 KB

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