Permalink
Browse files

[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
  • Loading branch information...
mgorny committed Dec 16, 2018
1 parent 3ab1289 commit c20c3d2c429ef395a67dbfaa1f6152c3cfbc769c
Showing with 4 additions and 0 deletions.
  1. +4 −0 libcxx/include/regex
@@ -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

0 comments on commit c20c3d2

Please sign in to comment.