summaryrefslogtreecommitdiff
path: root/XSUB.h
diff options
context:
space:
mode:
authorAaron Crane <arc@cpan.org>2017-10-13 15:56:07 +0200
committerAaron Crane <arc@cpan.org>2017-10-21 16:53:06 +0100
commitf12ee906ec242232139e92b04197e9f8a17e3f27 (patch)
tree801cb876912e715a16ead2aa3dcb6caa0eff0c82 /XSUB.h
parent6ec488b3d495e8c0c86a29f0ef861dc81dcb504c (diff)
downloadperl-f12ee906ec242232139e92b04197e9f8a17e3f27.tar.gz
XSUB.h: simplify cpp conditions using C89 "#elif"
Diffstat (limited to 'XSUB.h')
-rw-r--r--XSUB.h26
1 files changed, 10 insertions, 16 deletions
diff --git a/XSUB.h b/XSUB.h
index cff8204940..f637c91867 100644
--- a/XSUB.h
+++ b/XSUB.h
@@ -127,24 +127,18 @@ is a lexical C<$_> in scope.
#if defined(__CYGWIN__) && defined(USE_DYNAMIC_LOADING)
# define XS_EXTERNAL(name) __declspec(dllexport) XSPROTO(name)
# define XS_INTERNAL(name) STATIC XSPROTO(name)
-#endif
-#if defined(__SYMBIAN32__)
+#elif defined(__SYMBIAN32__)
# define XS_EXTERNAL(name) EXPORT_C XSPROTO(name)
# define XS_INTERNAL(name) EXPORT_C STATIC XSPROTO(name)
-#endif
-#ifndef XS_EXTERNAL
-# if defined(HASATTRIBUTE_UNUSED) && !defined(__cplusplus)
-# define XS_EXTERNAL(name) void name(pTHX_ CV* cv __attribute__unused__)
-# define XS_INTERNAL(name) STATIC void name(pTHX_ CV* cv __attribute__unused__)
-# else
-# ifdef __cplusplus
-# define XS_EXTERNAL(name) extern "C" XSPROTO(name)
-# define XS_INTERNAL(name) static XSPROTO(name)
-# else
-# define XS_EXTERNAL(name) XSPROTO(name)
-# define XS_INTERNAL(name) STATIC XSPROTO(name)
-# endif
-# endif
+#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
/* We do export xsub symbols by default for the public XS macro.