2 * {- join("\n * ", @autowarntext) -}
4 * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
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
12 #include <openssl/opensslv.h>
18 #ifdef OPENSSL_ALGORITHM_DEFINES
19 # error OPENSSL_ALGORITHM_DEFINES no longer supported
23 * OpenSSL was configured with the following options:
26 {- if (@{$config{openssl_sys_defines}}) {
27 foreach (@{$config{openssl_sys_defines}}) {
28 $OUT .= "#ifndef $_\n";
29 $OUT .= "# define $_ 1\n";
33 foreach (@{$config{openssl_api_defines}}) {
34 (my $macro, my $value) = $_ =~ /^(.*?)=(.*?)$/;
35 $OUT .= "#define $macro $value\n";
37 if (@{$config{openssl_feature_defines}}) {
38 foreach (@{$config{openssl_feature_defines}}) {
39 $OUT .= "#ifndef $_\n";
40 $OUT .= "# define $_\n";
48 * Sometimes OPENSSSL_NO_xxx ends up with an empty file and some compilers
49 * don't like that. This will hopefully silence them.
51 #define NON_EMPTY_TRANSLATION_UNIT static void *dummy = &dummy;
54 * Applications should use -DOPENSSL_API_COMPAT=<version> to suppress the
55 * declarations of functions deprecated in or before <version>. Otherwise, they
56 * still won't see them if the library has been built to disable deprecated
59 #ifndef DECLARE_DEPRECATED
60 # define DECLARE_DEPRECATED(f) f;
62 # if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 0)
63 # undef DECLARE_DEPRECATED
64 # define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated));
70 # ifdef OPENSSL_NO_FILENAMES
71 # define OPENSSL_FILE ""
72 # define OPENSSL_LINE 0
74 # define OPENSSL_FILE __FILE__
75 # define OPENSSL_LINE __LINE__
79 #ifndef OPENSSL_MIN_API
80 # define OPENSSL_MIN_API 0
83 #if !defined(OPENSSL_API_COMPAT) || OPENSSL_API_COMPAT < OPENSSL_MIN_API
84 # undef OPENSSL_API_COMPAT
85 # define OPENSSL_API_COMPAT OPENSSL_MIN_API
89 * Do not deprecate things to be deprecated in version 4.0 before the
90 * OpenSSL version number matches.
92 #if OPENSSL_VERSION_MAJOR < 4
93 # define DEPRECATEDIN_4(f) f;
94 #elif OPENSSL_API_COMPAT < 0x40000000L
95 # define DEPRECATEDIN_4(f) DECLARE_DEPRECATED(f)
97 # define DEPRECATEDIN_4(f)
100 #if OPENSSL_API_COMPAT < 0x30000000L
101 # define DEPRECATEDIN_3(f) DECLARE_DEPRECATED(f)
103 # define DEPRECATEDIN_3(f)
106 #if OPENSSL_API_COMPAT < 0x10100000L
107 # define DEPRECATEDIN_1_1_0(f) DECLARE_DEPRECATED(f)
109 # define DEPRECATEDIN_1_1_0(f)
112 #if OPENSSL_API_COMPAT < 0x10000000L
113 # define DEPRECATEDIN_1_0_0(f) DECLARE_DEPRECATED(f)
115 # define DEPRECATEDIN_1_0_0(f)
118 #if OPENSSL_API_COMPAT < 0x00908000L
119 # define DEPRECATEDIN_0_9_8(f) DECLARE_DEPRECATED(f)
121 # define DEPRECATEDIN_0_9_8(f)
124 /* Generate 80386 code? */
125 {- $config{processor} eq "386" ? "#define" : "#undef" -} I386_ONLY
127 #undef OPENSSL_UNISTD
128 #define OPENSSL_UNISTD {- $target{unistd} -}
130 {- $config{export_var_as_fn} ? "#define" : "#undef" -} OPENSSL_EXPORT_VAR_AS_FUNCTION
133 * The following are cipher-specific, but are part of the public API.
135 #if !defined(OPENSSL_SYS_UEFI)
136 {- $config{bn_ll} ? "# define" : "# undef" -} BN_LLONG
137 /* Only one for the following should be defined */
138 {- $config{b64l} ? "# define" : "# undef" -} SIXTY_FOUR_BIT_LONG
139 {- $config{b64} ? "# define" : "# undef" -} SIXTY_FOUR_BIT
140 {- $config{b32} ? "# define" : "# undef" -} THIRTY_TWO_BIT
143 #define RC4_INT {- $config{rc4_int} -}