summaryrefslogtreecommitdiff
path: root/warnings.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-10-07 18:27:05 -0600
committerKarl Williamson <khw@cpan.org>2020-10-07 19:29:06 -0600
commit6f17df98e8527068a9b9b55caf1492a90a9ac340 (patch)
tree883dff79c5cb8179bd2b328804e86b3fe2fc6262 /warnings.h
parent56910b4e617ab4c37cbf1d705811d6314daab9e8 (diff)
downloadperl-6f17df98e8527068a9b9b55caf1492a90a9ac340.tar.gz
Rename internal macros in warnings.h
This header defines 3 macros that are visible to XS code, but not for direct use of that code (they are not API). At least two of them are so short and generic that they could quite possibly conflict with symbols in that code 'Bit' and 'Off'. The third is somewhat less likely, 'IsSet', but not great. Rename them so that they contain 'Perl', so don't pollute the XS namespace.
Diffstat (limited to 'warnings.h')
-rw-r--r--warnings.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/warnings.h b/warnings.h
index f2008fe935..4d5b3ef1d5 100644
--- a/warnings.h
+++ b/warnings.h
@@ -5,9 +5,9 @@
*/
-#define Off(x) ((x) / 8)
-#define Bit(x) (1 << ((x) % 8))
-#define IsSet(a, x) ((a)[Off(x)] & Bit(x))
+#define Perl_Warn_Off_(x) ((x) / 8)
+#define Perl_Warn_Bit_(x) (1 << ((x) % 8))
+#define PerlWarnIsSet_(a, x) ((a)[Perl_Warn_Off_(x)] & Perl_Warn_Bit_(x))
#define G_WARN_OFF 0 /* $^W == 0 */
@@ -139,8 +139,8 @@
#define isLEXWARN_off \
cBOOL(!PL_curcop || PL_curcop->cop_warnings == pWARN_STD)
#define isWARN_ONCE (PL_dowarn & (G_WARN_ON|G_WARN_ONCE))
-#define isWARN_on(c,x) (IsSet((U8 *)(c + 1), 2*(x)))
-#define isWARNf_on(c,x) (IsSet((U8 *)(c + 1), 2*(x)+1))
+#define isWARN_on(c,x) (PerlWarnIsSet_((U8 *)(c + 1), 2*(x)))
+#define isWARNf_on(c,x) (PerlWarnIsSet_((U8 *)(c + 1), 2*(x)+1))
#define DUP_WARNINGS(p) Perl_dup_warnings(aTHX_ p)