[regex] Use distinct __regex_word on NetBSD

NetBSD defines character classes up to 0x2000.  Use 0x8000 as a safe
__regex_word that hopefully will not collide with other values
in the foreseeable future.

Differential Revision: https://reviews.llvm.org/D55657

llvm-svn: 349293
This commit is contained in:
Michal Gorny 2018-12-16 09:18:26 +00:00
parent 40b46d7cb5
commit a25cd0c2da
1 changed files with 4 additions and 0 deletions

View File

@ -990,6 +990,10 @@ public:
#if defined(__mips__) && defined(__GLIBC__)
static const char_class_type __regex_word = static_cast<char_class_type>(_ISbit(15));
#elif defined(__NetBSD__)
// NetBSD defines classes up to 0x2000
// see sys/ctype_bits.h, _CTYPE_Q
static const char_class_type __regex_word = 0x8000;
#else
static const char_class_type __regex_word = 0x80;
#endif