From: Rich Salz Date: Mon, 1 Jul 2019 18:54:53 +0000 (-0400) Subject: Remove global-var/function macros X-Git-Tag: openssl-3.0.0-alpha1~1833 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=66e2dbc01cb20b267bf132c945f49c303f63d7c4;p=oweals%2Fopenssl.git Remove global-var/function macros Reviewed-by: Tim Hudson Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/9284) --- diff --git a/include/openssl/e_os2.h b/include/openssl/e_os2.h index 250b3e2471..b1a99f3c48 100644 --- a/include/openssl/e_os2.h +++ b/include/openssl/e_os2.h @@ -163,29 +163,6 @@ extern "C" { # define OPENSSL_EXTERN extern # endif -/*- - * Macros to allow global variables to be reached through function calls when - * required (if a shared library version requires it, for example. - * The way it's done allows definitions like this: - * - * // in foobar.c - * OPENSSL_IMPLEMENT_GLOBAL(int,foobar,0) - * // in foobar.h - * OPENSSL_DECLARE_GLOBAL(int,foobar); - * #define foobar OPENSSL_GLOBAL_REF(foobar) - */ -# ifdef OPENSSL_EXPORT_VAR_AS_FUNCTION -# define OPENSSL_IMPLEMENT_GLOBAL(type,name,value) \ - type *_shadow_##name(void) \ - { static type _hide_##name=value; return &_hide_##name; } -# define OPENSSL_DECLARE_GLOBAL(type,name) type *_shadow_##name(void) -# define OPENSSL_GLOBAL_REF(name) (*(_shadow_##name())) -# else -# define OPENSSL_IMPLEMENT_GLOBAL(type,name,value) type _shadow_##name=value; -# define OPENSSL_DECLARE_GLOBAL(type,name) OPENSSL_EXPORT type _shadow_##name -# define OPENSSL_GLOBAL_REF(name) _shadow_##name -# endif - # ifdef _WIN32 # ifdef _WIN64 # define ossl_ssize_t __int64 diff --git a/util/libcrypto.num b/util/libcrypto.num index 9d95dabaaa..7d775134d9 100644 --- a/util/libcrypto.num +++ b/util/libcrypto.num @@ -2052,8 +2052,6 @@ ENGINE_unregister_RSA 2033 3_0_0 EXIST::FUNCTION:ENGINE EC_GROUP_order_bits 2034 3_0_0 EXIST::FUNCTION:EC d2i_CMS_bio 2035 3_0_0 EXIST::FUNCTION:CMS OPENSSL_sk_num 2036 3_0_0 EXIST::FUNCTION: -_shadow_DES_check_key 2037 3_0_0 NOEXIST:!EXPORT_VAR_AS_FUNCTION:VARIABLE:DES -_shadow_DES_check_key 2037 3_0_0 NOEXIST:EXPORT_VAR_AS_FUNCTION:FUNCTION:DES CMS_RecipientInfo_set0_pkey 2038 3_0_0 EXIST::FUNCTION:CMS X509_STORE_CTX_set_default 2039 3_0_0 EXIST::FUNCTION: AES_wrap_key 2040 3_0_0 EXIST::FUNCTION: diff --git a/util/missingmacro.txt b/util/missingmacro.txt index ef429c6a28..db4ce86eb3 100644 --- a/util/missingmacro.txt +++ b/util/missingmacro.txt @@ -63,7 +63,6 @@ CRYPTO_get_dynlock_destroy_callback OpenSSLDie OPENSSL_assert DSA_is_prime -OPENSSL_GLOBAL_REF ECParameters_dup ENGINE_load_openssl ENGINE_load_dynamic diff --git a/util/perl/OpenSSL/ParseC.pm b/util/perl/OpenSSL/ParseC.pm index 59b08e8dca..8e5b8b2e0a 100644 --- a/util/perl/OpenSSL/ParseC.pm +++ b/util/perl/OpenSSL/ParseC.pm @@ -255,19 +255,6 @@ my @opensslchandlers = ( # to this parser. All of these do replacements, anything else is # an error. - ##### - # Global variable stuff - { regexp => qr/OPENSSL_DECLARE_GLOBAL<<<\((.*),\s*(.*)\)>>>;/, - massager => sub { return (<<"EOF"); -#ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION -OPENSSL_EXPORT $1 _shadow_$2; -#else -$1 *_shadow_$2(void); -#endif -EOF - }, - }, - ##### # Deprecated stuff, by OpenSSL release.