X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/ab1478f7146843f73af03fea79b380f501564e86..675fa9ffbd41c6a7cf9b032d83e33f112a700be1:/XSUB.h diff --git a/XSUB.h b/XSUB.h index 5a5fc63..e5614fb 100644 --- a/XSUB.h +++ b/XSUB.h @@ -48,16 +48,15 @@ Used to access elements on the XSUB's stack. =for apidoc AmU||XS Macro to declare an XSUB and its C parameter list. This is handled by -C. +C. It is the same as using the more explicit XS_EXTERNAL macro. =for apidoc AmU||XS_INTERNAL Macro to declare an XSUB and its C parameter list without exporting the symbols. This is handled by C and generally preferable over exporting the XSUB -symbols unnecessarily. This is handled by C. +symbols unnecessarily. =for apidoc AmU||XS_EXTERNAL Macro to declare an XSUB and its C parameter list explicitly exporting the symbols. -This is handled by C. =for apidoc Ams||dAX Sets up the C variable. @@ -131,7 +130,7 @@ is a lexical $_ in scope. #undef XS_INTERNAL #if defined(__CYGWIN__) && defined(USE_DYNAMIC_LOADING) # define XS_EXTERNAL(name) __declspec(dllexport) XSPROTO(name) -# define XS_INTERNAL(name) __declspec(dllexport) STATIC XSPROTO(name) +# define XS_INTERNAL(name) STATIC XSPROTO(name) #endif #if defined(__SYMBIAN32__) # define XS_EXTERNAL(name) EXPORT_C XSPROTO(name) @@ -144,7 +143,7 @@ is a lexical $_ in scope. # else # ifdef __cplusplus # define XS_EXTERNAL(name) extern "C" XSPROTO(name) -# define XS_INTERNAL(name) extern "C" STATIC XSPROTO(name) +# define XS_INTERNAL(name) static XSPROTO(name) # else # define XS_EXTERNAL(name) XSPROTO(name) # define XS_INTERNAL(name) STATIC XSPROTO(name) @@ -152,14 +151,15 @@ is a lexical $_ in scope. # endif #endif -/* We do not export xsub symbols any more by default */ -#define XS(name) XS_INTERNAL(name) +/* We do export xsub symbols by default for the public XS macro. + * Try explicitly using XS_INTERNAL/XS_EXTERNAL instead, please. */ +#define XS(name) XS_EXTERNAL(name) #define dAX const I32 ax = (I32)(MARK - PL_stack_base + 1) #define dAXMARK \ I32 ax = POPMARK; \ - register SV **mark = PL_stack_base + ax++ + SV **mark = PL_stack_base + ax++ #define dITEMS I32 items = (I32)(SP - MARK) @@ -635,18 +635,16 @@ Rethrows a previously caught exception. See L. # define socketpair PerlSock_socketpair # endif /* NETWARE && USE_STDIO */ -# ifdef USE_SOCKETS_AS_HANDLES -# undef fd_set -# undef FD_SET -# undef FD_CLR -# undef FD_ISSET -# undef FD_ZERO -# define fd_set Perl_fd_set -# define FD_SET(n,p) PERL_FD_SET(n,p) -# define FD_CLR(n,p) PERL_FD_CLR(n,p) -# define FD_ISSET(n,p) PERL_FD_ISSET(n,p) -# define FD_ZERO(p) PERL_FD_ZERO(p) -# endif /* USE_SOCKETS_AS_HANDLES */ +# undef fd_set +# undef FD_SET +# undef FD_CLR +# undef FD_ISSET +# undef FD_ZERO +# define fd_set Perl_fd_set +# define FD_SET(n,p) PERL_FD_SET(n,p) +# define FD_CLR(n,p) PERL_FD_CLR(n,p) +# define FD_ISSET(n,p) PERL_FD_ISSET(n,p) +# define FD_ZERO(p) PERL_FD_ZERO(p) # endif /* NO_XSLOCKS */ #endif /* PERL_IMPLICIT_SYS && !PERL_CORE */ @@ -657,8 +655,8 @@ Rethrows a previously caught exception. See L. * Local variables: * c-indentation-style: bsd * c-basic-offset: 4 - * indent-tabs-mode: t + * indent-tabs-mode: nil * End: * - * ex: set ts=8 sts=4 sw=4 noet: + * ex: set ts=8 sts=4 sw=4 et: */