Skip to content

Commit 69eae3a

Browse files
committed
Fix definitions of LIKELY and UNLIKELY on older perls
1 parent 23e1de3 commit 69eae3a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

vutil/vutil.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ static const char * Perl_prescan_version2(pTHX_ const char *s, bool strict, cons
4747
# define is_STRICT_VERSION(a,b) \
4848
(a != Perl_prescan_version2(aTHX_ a, TRUE, b, NULL, NULL, NULL, NULL))
4949

50+
#if PERL_VERSION_LT(5, 19, 1)
51+
#undef LIKELY
52+
#define LIKELY(cond) EXPECT(cBOOL(cond),TRUE)
53+
#undef UNLIKELY
54+
#define UNLIKELY(cond) EXPECT(cBOOL(cond),FALSE)
55+
#endif
56+
5057
#else
5158

5259
const char * Perl_scan_version(pTHX_ const char *s, SV *rv, bool qv);

0 commit comments

Comments
 (0)