
253: /* Macros to allow global variables to be reached through function calls when 254: required (if a shared library version requvres it, for example. 255: The way it's done allows definitions like this: 256: 257: // in foobar.c 258: OPENSSL_IMPLEMENT_GLOBAL(int,foobar) = 0; 259: // in foobar.h 260: OPENSSL_DECLARE_GLOBAL(int,foobar); 261: #define foobar OPENSSL_GLOBAL_REF(foobar) 262: */ 263: #ifdef OPENSSL_EXPORT_VAR_AS_FUNCTION 264: # define OPENSSL_IMPLEMENT_GLOBAL(type,name) \ 265: extern type _hide_##name; \ 266: type *_shadow_##name(void) { return &_hide_##name; } \ 267: static type _hide_##name
グローバル変数を extern で宣言して (265)、static で定義している (267)。 mingw32 の gcc でこけます。 やりたいことは分かるんだけど。。