summaryrefslogtreecommitdiff
path: root/handy.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2020-12-04 07:40:54 -0700
committerKarl Williamson <khw@cpan.org>2020-12-06 13:57:11 -0700
commit1442da54429bca166af716cb981dc150644ad203 (patch)
tree18a31fe1f9ce8b76e568c49d31064ef82ed4935b /handy.h
parent2de541a7c621c3f3e23da3d477977c545a78bf87 (diff)
downloadperl-1442da54429bca166af716cb981dc150644ad203.tar.gz
Revert "Don't test for 16-bit inputs in inRANGE()"
This effectively reverts commit 4c2aa7c802893d0276551ade1b9d5dcd1226afc4. That commit removed checking for 16 bit inputs because an assert in a macro was making compilations fail in some compilers that couldn't handle the complexity. This inadvertently broke systems which use C language shorts in certain places, such Mingw and Win32 with their use of UTF16, not typically found on other platforms. At the time, we weren't smoking Mingw so we didn't know about it there, but the Win32 failures on Win32 were "fixed" by another commit which disabled assertions of this type completely. It turns out the issue was passing too long a string to assert(). Commits 92a0bb2 and 88086fd removed a bunch of unnecessary and/or duplicate asserts, bringing the size down, so that the 16 bit checks can be added back in without breaking these compilers. The reverted commit mentioned HP compilers as having problems. The only such box we currently have available for testing is HP-31, and the reversion works fine on it, even before 92a0bb2 and 88086fd. This fixes GH #18364
Diffstat (limited to 'handy.h')
-rw-r--r--handy.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/handy.h b/handy.h
index 05dbec300e..f0a2a3cb75 100644
--- a/handy.h
+++ b/handy.h
@@ -1426,6 +1426,7 @@ or casts
* needed. */
#define inRANGE(c, l, u) (__ASSERT_((NV) (l) >= 0) __ASSERT_((u) >= (l)) \
( (sizeof(c) == sizeof(U8)) ? inRANGE_helper_(U8, (c), (l), ((u))) \
+ : (sizeof(c) == sizeof(U16)) ? inRANGE_helper_(U16,(c), (l), ((u))) \
: (sizeof(c) == sizeof(U32)) ? inRANGE_helper_(U32,(c), (l), ((u))) \
: (__ASSERT_(sizeof(c) == sizeof(WIDEST_UTYPE)) \
inRANGE_helper_(WIDEST_UTYPE,(c), (l), ((u))))))