mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 15:30:40 +08:00
Migrate PUA constants out of wutil.h
These defines are only used inside the .cpp file. Place them in there and switch to an enum.
This commit is contained in:
parent
23bf98e6bb
commit
9a3a67ba31
|
@ -516,6 +516,15 @@ ssize_t wwrite_to_fd(const wchar_t *input, size_t input_len, int fd) {
|
|||
return success ? total_written : -1;
|
||||
}
|
||||
|
||||
enum : wint_t {
|
||||
PUA1_START = 0xE000,
|
||||
PUA1_END = 0xF900,
|
||||
PUA2_START = 0xF0000,
|
||||
PUA2_END = 0xFFFFE,
|
||||
PUA3_START = 0x100000,
|
||||
PUA3_END = 0x10FFFE,
|
||||
};
|
||||
|
||||
/// Return one if the code point is in a Unicode private use area.
|
||||
static int fish_is_pua(wint_t wc) {
|
||||
if (PUA1_START <= wc && wc < PUA1_END) return 1;
|
||||
|
|
|
@ -106,13 +106,6 @@ inline ssize_t wwrite_to_fd(const wcstring &s, int fd) {
|
|||
return wwrite_to_fd(s.c_str(), s.size(), fd);
|
||||
}
|
||||
|
||||
#define PUA1_START 0xE000
|
||||
#define PUA1_END 0xF900
|
||||
#define PUA2_START 0xF0000
|
||||
#define PUA2_END 0xFFFFE
|
||||
#define PUA3_START 0x100000
|
||||
#define PUA3_END 0x10FFFE
|
||||
|
||||
// We need this because there are too many implementations that don't return the proper answer for
|
||||
// some code points. See issue #3050.
|
||||
#ifndef FISH_NO_ISW_WRAPPERS
|
||||
|
|
Loading…
Reference in New Issue
Block a user