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