From e4317d2031759900d964e6f2ab03589b4317dfa2 Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Sun, 20 May 2007 20:11:19 +0000 Subject: OPENSSL_IMPLEMENT_GLOBAL caused more grief than it's worth (it's used twice in legacy code). I'd rather just remove it along with legacy interface, but it's probably not as appropriate as I'd like. Reimplement the macro. --- e_os2.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'e_os2.h') diff --git a/e_os2.h b/e_os2.h index 3f72b06786..e17527ab40 100644 --- a/e_os2.h +++ b/e_os2.h @@ -266,20 +266,19 @@ extern "C" { The way it's done allows definitions like this: // in foobar.c - OPENSSL_IMPLEMENT_GLOBAL(int,foobar) = 0; + 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) \ - extern type _hide_##name; \ - type *_shadow_##name(void) { return &_hide_##name; } \ - static type _hide_##name +# 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) OPENSSL_GLOBAL type _shadow_##name +# define OPENSSL_IMPLEMENT_GLOBAL(type,name,value) OPENSSL_GLOBAL type _shadow_##name=value; # define OPENSSL_DECLARE_GLOBAL(type,name) OPENSSL_EXPORT type _shadow_##name # define OPENSSL_GLOBAL_REF(name) _shadow_##name #endif -- cgit v1.2.3