Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XSUB.h: simplify XS_INTERNAL/XS_EXTERNAL macros #22890

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions XSUB.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,6 @@ is a lexical C<$_> in scope.
* typedef SwigPerlWrapper *SwigPerlWrapperPtr;
*
* This code needs to be compilable under both C and C++.
*
* Don't forget to change the __attribute__unused__ version of XS()
* below too if you change XSPROTO() here.
*/

/* XS_INTERNAL is the explicit static-linkage variant of the default
Expand All @@ -141,17 +138,12 @@ is a lexical C<$_> in scope.
#undef XS_INTERNAL
#if defined(__CYGWIN__) && defined(USE_DYNAMIC_LOADING)
# define XS_EXTERNAL(name) __declspec(dllexport) XSPROTO(name)
# define XS_INTERNAL(name) STATIC XSPROTO(name)
#elif defined(__cplusplus)
# define XS_EXTERNAL(name) extern "C" XSPROTO(name)
# define XS_INTERNAL(name) static XSPROTO(name)
#elif defined(HASATTRIBUTE_UNUSED)
# define XS_EXTERNAL(name) void name(pTHX_ CV* cv __attribute__unused__)
# define XS_INTERNAL(name) STATIC void name(pTHX_ CV* cv __attribute__unused__)
#else
# define XS_EXTERNAL(name) XSPROTO(name)
# define XS_INTERNAL(name) STATIC XSPROTO(name)
#endif
#define XS_INTERNAL(name) STATIC XSPROTO(name)

/* We do export xsub symbols by default for the public XS macro.
* Try explicitly using XS_INTERNAL/XS_EXTERNAL instead, please. */
Expand Down
Loading