diff options
author | Marcus Holland-Moritz <mhx-perl@gmx.net> | 2009-01-23 22:11:38 +0100 |
---|---|---|
committer | Marcus Holland-Moritz <mhx-perl@gmx.net> | 2009-01-23 22:11:38 +0100 |
commit | cf5a8da6882fed918a9d80d63b4aec653697b040 (patch) | |
tree | 5a7f4e53c8b419aa39e5fe3df524f5b0475c4af6 | |
parent | ac2e3cea0e22de754d302c36777a64e04fb938ce (diff) | |
download | perl-cf5a8da6882fed918a9d80d63b4aec653697b040.tar.gz |
Ensure that C++ modules can be built against a perl configured with -DPERL_GLOBAL_STRUCT_PRIVATE.
Perl_GetVarsPrivate() could not be seen from within a module built
with a C++ compiler if the perl binary was built with a C compiler,
as the prototype was not 'extern "C"' for C++.
The change moves the EXTERN_C defines so they can be used for the
prototype of Perl_GetVarsPrivate().
-rw-r--r-- | perl.h | 28 |
1 files changed, 14 insertions, 14 deletions
@@ -145,10 +145,23 @@ # endif #endif +#undef START_EXTERN_C +#undef END_EXTERN_C +#undef EXTERN_C +#ifdef __cplusplus +# define START_EXTERN_C extern "C" { +# define END_EXTERN_C } +# define EXTERN_C extern "C" +#else +# define START_EXTERN_C +# define END_EXTERN_C +# define EXTERN_C extern +#endif + #ifdef PERL_GLOBAL_STRUCT # ifndef PERL_GET_VARS # ifdef PERL_GLOBAL_STRUCT_PRIVATE - extern struct perl_vars* Perl_GetVarsPrivate(); + EXTERN_C struct perl_vars* Perl_GetVarsPrivate(); # define PERL_GET_VARS() Perl_GetVarsPrivate() /* see miniperlmain.c */ # ifndef PERLIO_FUNCS_CONST # define PERLIO_FUNCS_CONST /* Can't have these lying around. */ @@ -405,19 +418,6 @@ # endif #endif -#undef START_EXTERN_C -#undef END_EXTERN_C -#undef EXTERN_C -#ifdef __cplusplus -# define START_EXTERN_C extern "C" { -# define END_EXTERN_C } -# define EXTERN_C extern "C" -#else -# define START_EXTERN_C -# define END_EXTERN_C -# define EXTERN_C extern -#endif - /* Some platforms require marking function declarations * for them to be exportable. Used in perlio.h, proto.h * is handled either by the makedef.pl or by defining the |