From 7a06760e6face1fda50c8da52a9c2bc0e505b021 Mon Sep 17 00:00:00 2001 From: tkchia Date: Tue, 11 Oct 2022 11:31:25 +0800 Subject: [PATCH] Rename LINUX to _HOSTLINUX etc. to reduce clashes (#655) Co-authored-by: tkchia --- ape/ape.S | 4 +-- ape/loader-elf.S | 4 +-- ape/loader-macho.S | 4 +-- libc/calls/sigaction.c | 20 +++++------ libc/crt/crt.S | 4 +-- libc/dce.h | 62 ++++++++++++++++---------------- libc/intrin/sched_yield.S | 4 +-- libc/runtime/arch_prctl.c | 12 +++---- libc/runtime/efimain.greg.c | 2 +- libc/runtime/winmain.greg.c | 2 +- libc/sysv/syscall.S | 10 +++--- libc/sysv/systemfive.S | 8 ++--- net/finger/getsynfingeros.c | 10 +++--- test/net/finger/fingersyn_test.c | 22 ++++++------ tool/net/redbean.c | 2 +- 15 files changed, 85 insertions(+), 85 deletions(-) diff --git a/ape/ape.S b/ape/ape.S index 72dbc8115..e8c12bf4f 100644 --- a/ape/ape.S +++ b/ape/ape.S @@ -874,7 +874,7 @@ ape_macho: .long (520f-510f)/4 # count 510: .quad 0 # rax .quad IMAGE_BASE_VIRTUAL # rbx - .quad XNU # rcx + .quad _HOSTXNU # rcx .quad 0 # rdx .quad 0 # rdi .quad 0 # rsi @@ -1555,7 +1555,7 @@ kernel: movabs $ape_stack_vaddr,%rsp .byte 0x0f,0x1f,0207 # nop rdi binbase .long (IMAGE_BASE_VIRTUAL-IMAGE_BASE_REAL)/512 #endif - push $METAL # sets __hostos in crt.S + push $_HOSTMETAL # sets __hostos in crt.S pop %rcx push $0 mov %rsp,%rbp diff --git a/ape/loader-elf.S b/ape/loader-elf.S index 5e2c3725c..77c4a3764 100644 --- a/ape/loader-elf.S +++ b/ape/loader-elf.S @@ -175,7 +175,7 @@ macho: .long 0xFEEDFACE+1 510: .quad 0 # rax .quad 0 # rbx .quad 0 # rcx - .quad XNU # rdx + .quad _HOSTXNU # rdx .quad 0 # rdi .quad 0 # rsi .quad 0 # rbp @@ -221,7 +221,7 @@ _start: jne 0f cmp $+1,%edx jne 0f - mov $XNU,%dl + mov $_HOSTXNU,%dl xor %ecx,%ecx 0: mov %rsp,%rsi diff --git a/ape/loader-macho.S b/ape/loader-macho.S index 5bd2bbcd5..82a1e02a6 100644 --- a/ape/loader-macho.S +++ b/ape/loader-macho.S @@ -90,7 +90,7 @@ macho: .long 0xFEEDFACE+1 510: .quad 0 # rax .quad 0 # rbx .quad 0 # rcx - .quad XNU # rdx + .quad _HOSTXNU # rdx .quad 0 # rdi .quad 0 # rsi .quad 0 # rbp @@ -121,7 +121,7 @@ _start: jne 0f cmp $+1,%edx jne 0f - mov $XNU,%dl + mov $_HOSTXNU,%dl xor %ecx,%ecx 0: mov %rsp,%rsi diff --git a/libc/calls/sigaction.c b/libc/calls/sigaction.c index 650a267f3..4aab5d495 100644 --- a/libc/calls/sigaction.c +++ b/libc/calls/sigaction.c @@ -90,23 +90,23 @@ void __sigenter_openbsd(int, void *, void *) hidden; static void sigaction_cosmo2native(union metasigaction *sa) { if (!sa) return; switch (__hostos) { - case LINUX: + case _HOSTLINUX: SWITCHEROO(sa->cosmo, sa->linux, sa_handler, sa_flags, sa_restorer, sa_mask); break; - case XNU: + case _HOSTXNU: SWITCHEROO(sa->cosmo, sa->xnu_in, sa_handler, sa_flags, sa_restorer, sa_mask); break; - case FREEBSD: + case _HOSTFREEBSD: SWITCHEROO(sa->cosmo, sa->freebsd, sa_handler, sa_flags, sa_flags, sa_mask); break; - case OPENBSD: + case _HOSTOPENBSD: SWITCHEROO(sa->cosmo, sa->openbsd, sa_handler, sa_flags, sa_flags, sa_mask); break; - case NETBSD: + case _HOSTNETBSD: SWITCHEROO(sa->cosmo, sa->netbsd, sa_handler, sa_flags, sa_flags, sa_mask); break; @@ -118,23 +118,23 @@ static void sigaction_cosmo2native(union metasigaction *sa) { static void sigaction_native2cosmo(union metasigaction *sa) { if (!sa) return; switch (__hostos) { - case LINUX: + case _HOSTLINUX: SWITCHEROO(sa->linux, sa->cosmo, sa_handler, sa_flags, sa_restorer, sa_mask); break; - case XNU: + case _HOSTXNU: SWITCHEROO(sa->xnu_out, sa->cosmo, sa_handler, sa_flags, sa_flags, sa_mask); break; - case FREEBSD: + case _HOSTFREEBSD: SWITCHEROO(sa->freebsd, sa->cosmo, sa_handler, sa_flags, sa_flags, sa_mask); break; - case OPENBSD: + case _HOSTOPENBSD: SWITCHEROO(sa->openbsd, sa->cosmo, sa_handler, sa_flags, sa_flags, sa_mask); break; - case NETBSD: + case _HOSTNETBSD: SWITCHEROO(sa->netbsd, sa->cosmo, sa_handler, sa_flags, sa_flags, sa_mask); break; diff --git a/libc/crt/crt.S b/libc/crt/crt.S index 178691f91..6b79877b0 100644 --- a/libc/crt/crt.S +++ b/libc/crt/crt.S @@ -38,7 +38,7 @@ _start: jne 0f cmp $+1,%edx jne 0f - mov $XNU,%cl + mov $_HOSTXNU,%cl xor %edi,%edi 0: #endif @@ -48,7 +48,7 @@ _start: test %rdi,%rdi cmovnz %rdi,%rsp jz 0f - movb $FREEBSD,%cl + movb $_HOSTFREEBSD,%cl 0: #endif diff --git a/libc/dce.h b/libc/dce.h index 04b102d20..a27efb312 100644 --- a/libc/dce.h +++ b/libc/dce.h @@ -12,13 +12,13 @@ #define SUPPORT_VECTOR 255 #endif -#define LINUX 1 -#define METAL 2 -#define WINDOWS 4 -#define XNU 8 -#define OPENBSD 16 -#define FREEBSD 32 -#define NETBSD 64 +#define _HOSTLINUX 1 +#define _HOSTMETAL 2 +#define _HOSTWINDOWS 4 +#define _HOSTXNU 8 +#define _HOSTOPENBSD 16 +#define _HOSTFREEBSD 32 +#define _HOSTNETBSD 64 #ifdef NDEBUG #define NoDebug() 1 @@ -68,36 +68,36 @@ #define IsPositionIndependent() 0 #endif -#define SupportsLinux() ((SUPPORT_VECTOR & LINUX) == LINUX) -#define SupportsMetal() ((SUPPORT_VECTOR & METAL) == METAL) -#define SupportsWindows() ((SUPPORT_VECTOR & WINDOWS) == WINDOWS) -#define SupportsXnu() ((SUPPORT_VECTOR & XNU) == XNU) -#define SupportsFreebsd() ((SUPPORT_VECTOR & FREEBSD) == FREEBSD) -#define SupportsOpenbsd() ((SUPPORT_VECTOR & OPENBSD) == OPENBSD) -#define SupportsNetbsd() ((SUPPORT_VECTOR & NETBSD) == NETBSD) -#define SupportsBsd() (!!(SUPPORT_VECTOR & (XNU | FREEBSD | OPENBSD | NETBSD))) +#define SupportsLinux() ((SUPPORT_VECTOR & _HOSTLINUX) == _HOSTLINUX) +#define SupportsMetal() ((SUPPORT_VECTOR & _HOSTMETAL) == _HOSTMETAL) +#define SupportsWindows() ((SUPPORT_VECTOR & _HOSTWINDOWS) == _HOSTWINDOWS) +#define SupportsXnu() ((SUPPORT_VECTOR & _HOSTXNU) == _HOSTXNU) +#define SupportsFreebsd() ((SUPPORT_VECTOR & _HOSTFREEBSD) == _HOSTFREEBSD) +#define SupportsOpenbsd() ((SUPPORT_VECTOR & _HOSTOPENBSD) == _HOSTOPENBSD) +#define SupportsNetbsd() ((SUPPORT_VECTOR & _HOSTNETBSD) == _HOSTNETBSD) +#define SupportsBsd() (!!(SUPPORT_VECTOR & (_HOSTXNU | _HOSTFREEBSD | _HOSTOPENBSD | _HOSTNETBSD))) #define SupportsSystemv() \ - (!!(SUPPORT_VECTOR & (LINUX | XNU | OPENBSD | FREEBSD | NETBSD))) + (!!(SUPPORT_VECTOR & (_HOSTLINUX | _HOSTXNU | _HOSTOPENBSD | _HOSTFREEBSD | _HOSTNETBSD))) #ifndef __ASSEMBLER__ -#define IsLinux() (SupportsLinux() && (__hostos & LINUX)) -#define IsMetal() (SupportsMetal() && (__hostos & METAL)) -#define IsWindows() (SupportsWindows() && (__hostos & WINDOWS)) -#define IsXnu() (SupportsXnu() && (__hostos & XNU)) -#define IsFreebsd() (SupportsFreebsd() && (__hostos & FREEBSD)) -#define IsOpenbsd() (SupportsOpenbsd() && (__hostos & OPENBSD)) -#define IsNetbsd() (SupportsNetbsd() && (__hostos & NETBSD)) +#define IsLinux() (SupportsLinux() && (__hostos & _HOSTLINUX)) +#define IsMetal() (SupportsMetal() && (__hostos & _HOSTMETAL)) +#define IsWindows() (SupportsWindows() && (__hostos & _HOSTWINDOWS)) +#define IsXnu() (SupportsXnu() && (__hostos & _HOSTXNU)) +#define IsFreebsd() (SupportsFreebsd() && (__hostos & _HOSTFREEBSD)) +#define IsOpenbsd() (SupportsOpenbsd() && (__hostos & _HOSTOPENBSD)) +#define IsNetbsd() (SupportsNetbsd() && (__hostos & _HOSTNETBSD)) #define IsBsd() (IsXnu() || IsFreebsd() || IsOpenbsd() || IsNetbsd()) #else /* clang-format off */ -#define IsLinux() $LINUX,__hostos(%rip) -#define IsMetal() $METAL,__hostos(%rip) -#define IsWindows() $WINDOWS,__hostos(%rip) -#define IsBsd() $XNU|FREEBSD|OPENBSD|NETBSD,__hostos(%rip) -#define IsXnu() $XNU,__hostos(%rip) -#define IsFreebsd() $FREEBSD,__hostos(%rip) -#define IsOpenbsd() $OPENBSD,__hostos(%rip) -#define IsNetbsd() $NETBSD,__hostos(%rip) +#define IsLinux() $_HOSTLINUX,__hostos(%rip) +#define IsMetal() $_HOSTMETAL,__hostos(%rip) +#define IsWindows() $_HOSTWINDOWS,__hostos(%rip) +#define IsBsd() $_HOSTXNU|_HOSTFREEBSD|_HOSTOPENBSD|_HOSTNETBSD,__hostos(%rip) +#define IsXnu() $_HOSTXNU,__hostos(%rip) +#define IsFreebsd() $_HOSTFREEBSD,__hostos(%rip) +#define IsOpenbsd() $_HOSTOPENBSD,__hostos(%rip) +#define IsNetbsd() $_HOSTNETBSD,__hostos(%rip) /* clang-format on */ #endif diff --git a/libc/intrin/sched_yield.S b/libc/intrin/sched_yield.S index b6b1f10b2..79cda580a 100644 --- a/libc/intrin/sched_yield.S +++ b/libc/intrin/sched_yield.S @@ -32,7 +32,7 @@ sched_yield: mov __hostos(%rip),%dl #if SupportsMetal() - testb $METAL,%dl + testb $_HOSTMETAL,%dl jnz 9f #endif @@ -46,7 +46,7 @@ sched_yield: // threads ready to run and no user APCs are queued, the function // returns immediately, and the thread continues execution. // ──Quoth MSDN - testb $WINDOWS,%dl + testb $_HOSTWINDOWS,%dl jz 1f xor %ecx,%ecx xor %edx,%edx diff --git a/libc/runtime/arch_prctl.c b/libc/runtime/arch_prctl.c index a5710ea26..ffc985ad2 100644 --- a/libc/runtime/arch_prctl.c +++ b/libc/runtime/arch_prctl.c @@ -205,22 +205,22 @@ int arch_prctl(int code, int64_t addr) { rc = efault(); } else { switch (__hostos) { - case METAL: + case _HOSTMETAL: rc = arch_prctl_msr(code, addr); break; - case FREEBSD: + case _HOSTFREEBSD: rc = arch_prctl_freebsd(code, addr); break; - case NETBSD: + case _HOSTNETBSD: rc = arch_prctl_netbsd(code, addr); break; - case OPENBSD: + case _HOSTOPENBSD: rc = arch_prctl_openbsd(code, addr); break; - case LINUX: + case _HOSTLINUX: rc = sys_arch_prctl(code, addr); break; - case XNU: + case _HOSTXNU: rc = arch_prctl_xnu(code, addr); break; default: diff --git a/libc/runtime/efimain.greg.c b/libc/runtime/efimain.greg.c index 4b64dd6e0..4930fd14b 100644 --- a/libc/runtime/efimain.greg.c +++ b/libc/runtime/efimain.greg.c @@ -74,7 +74,7 @@ __msabi noasan EFI_STATUS EfiMain(EFI_HANDLE ImageHandle, uint64_t p, pe, cr4, *m, *pd, *sp, *pml4t, *pdt1, *pdt2, *pdpt1, *pdpt2; extern char __os asm("__hostos"); - __os = METAL; + __os = _HOSTMETAL; /* * Allocates and clears PC-compatible memory and copies image. diff --git a/libc/runtime/winmain.greg.c b/libc/runtime/winmain.greg.c index 3abc226bb..85ce9698d 100644 --- a/libc/runtime/winmain.greg.c +++ b/libc/runtime/winmain.greg.c @@ -266,7 +266,7 @@ __msabi textwindows int64_t WinMain(int64_t hInstance, int64_t hPrevInstance, const char *lpCmdLine, int64_t nCmdShow) { const char16_t *cmdline; extern char os asm("__hostos"); - os = WINDOWS; /* madness https://news.ycombinator.com/item?id=21019722 */ + os = _HOSTWINDOWS; /* madness https://news.ycombinator.com/item?id=21019722 */ kStartTsc = rdtsc(); __pid = GetCurrentProcessId(); #if !IsTiny() diff --git a/libc/sysv/syscall.S b/libc/sysv/syscall.S index 6cffdcf8a..61a925f21 100644 --- a/libc/sysv/syscall.S +++ b/libc/sysv/syscall.S @@ -52,21 +52,21 @@ syscall: // convert from consts.sh to syscalls.sh encoding push %rcx mov __hostos(%rip),%cl - test $LINUX,%cl + test $_HOSTLINUX,%cl jnz 2f -1: test $FREEBSD,%cl +1: test $_HOSTFREEBSD,%cl jz 1f shl $4*7,%rax jmp 2f -1: test $OPENBSD,%cl +1: test $_HOSTOPENBSD,%cl jz 1f shl $4*10,%rax jmp 2f -1: test $NETBSD,%cl +1: test $_HOSTNETBSD,%cl jz 1f shl $4*13,%rax jmp 2f -1: test $XNU,%cl +1: test $_HOSTXNU,%cl jz 2f mov %eax,%ecx and $0x0f000000,%ecx diff --git a/libc/sysv/systemfive.S b/libc/sysv/systemfive.S index fd88a4d4a..ba906ed13 100644 --- a/libc/sysv/systemfive.S +++ b/libc/sysv/systemfive.S @@ -219,7 +219,7 @@ systemfive_xnu: #if SupportsOpenbsd() cmpq $0,(%r15) # OpenBSD has no auxv jnz 0f - mov $OPENBSD,%al + mov $_HOSTOPENBSD,%al jmp _init_systemfive_detected 0: #endif @@ -227,14 +227,14 @@ systemfive_xnu: xor %ecx,%ecx 0: cmpq $2014,(%r15,%rcx,8) # NetBSD's AT_EXECFN jne 1f - mov $NETBSD,%al + mov $_HOSTNETBSD,%al jmp _init_systemfive_detected 1: cmpq $0,(%r15,%rcx,8) lea 2(%ecx),%ecx jnz 0b 2: #endif - mov $LINUX,%al + mov $_HOSTLINUX,%al _init_systemfive_detected: stosq #→ __hostos bsr %eax,%eax @@ -356,7 +356,7 @@ _init_systemfive_pid: ezlea __hostos,cx mov (%rcx),%al mov (%rdi),%eax - testb $WINDOWS|METAL,(%rcx) + testb $_HOSTWINDOWS|_HOSTMETAL,(%rcx) jnz 1f mov __NR_getpid,%eax syscall diff --git a/net/finger/getsynfingeros.c b/net/finger/getsynfingeros.c index 1d5e2a5ab..c7d95195b 100644 --- a/net/finger/getsynfingeros.c +++ b/net/finger/getsynfingeros.c @@ -25,15 +25,15 @@ int GetSynFingerOs(uint32_t x) { switch (x) { case 0x7e7a6599: - return XNU; + return _HOSTXNU; case 0xbb724187: - return LINUX; + return _HOSTLINUX; case 0xb228b212: - return WINDOWS; + return _HOSTWINDOWS; case 0x77c30887: - return FREEBSD; + return _HOSTFREEBSD; case 0xc45d694b: - return OPENBSD; + return _HOSTOPENBSD; default: return 0; } diff --git a/test/net/finger/fingersyn_test.c b/test/net/finger/fingersyn_test.c index 1224791ea..f358beb27 100644 --- a/test/net/finger/fingersyn_test.c +++ b/test/net/finger/fingersyn_test.c @@ -27,7 +27,7 @@ TEST(FingerSyn, testWindows7_isWindows) { \x7f\x0a\x0a\x7c\xc3\x9e\x1b\x58\x12\x38\xfe\xd3\x00\x00\x00\x00\ \x80\x02\x20\x00\x35\xee\x00\x00\x02\x04\x05\xb4\x01\x03\x03\x02\ \x01\x01\x04\x02"; - EXPECT_EQ(WINDOWS, GetSynFingerOs(FingerSyn(s, sizeof(s) - 1))); + EXPECT_EQ(_HOSTWINDOWS, GetSynFingerOs(FingerSyn(s, sizeof(s) - 1))); } TEST(FingerSyn, testWindows10_isWindows) { @@ -36,7 +36,7 @@ TEST(FingerSyn, testWindows10_isWindows) { \x7f\x0a\x0a\x7c\xed\xf2\x1b\x58\xeb\xa6\xa7\xb0\x00\x00\x00\x00\ \x80\x02\xfa\xf0\xae\xe0\x00\x00\x02\x04\x05\xb4\x01\x03\x03\x08\ \x01\x01\x04\x02"; - EXPECT_EQ(WINDOWS, GetSynFingerOs(FingerSyn(s, sizeof(s) - 1))); + EXPECT_EQ(_HOSTWINDOWS, GetSynFingerOs(FingerSyn(s, sizeof(s) - 1))); } TEST(FingerSyn, testLinuxAlpine_isLinux) { @@ -45,7 +45,7 @@ TEST(FingerSyn, testLinuxAlpine_isLinux) { \x7f\x0a\x0a\x7c\xee\x32\x1b\x58\xfe\xa9\xa4\xae\x00\x00\x00\x00\ \xa0\x02\xff\xd7\x29\x3a\x00\x00\x02\x04\xff\xd7\x04\x02\x08\x0a\ \x43\x3d\xab\x7c\x00\x00\x00\x00\x01\x03\x03\x07"; - EXPECT_EQ(LINUX, GetSynFingerOs(FingerSyn(s, sizeof(s) - 1))); + EXPECT_EQ(_HOSTLINUX, GetSynFingerOs(FingerSyn(s, sizeof(s) - 1))); } TEST(FingerSyn, testLinuxDebian_isLinux) { @@ -54,7 +54,7 @@ TEST(FingerSyn, testLinuxDebian_isLinux) { \x7f\x0a\x0a\x7c\xe2\x24\x1b\x58\xf6\xe9\xf2\x85\x00\x00\x00\x00\ \xa0\x02\xfa\xf0\x5f\xac\x00\x00\x02\x04\x05\xb4\x04\x02\x08\x0a\ \x4a\x43\x93\x29\x00\x00\x00\x00\x01\x03\x03\x07"; - EXPECT_EQ(LINUX, GetSynFingerOs(FingerSyn(s, sizeof(s) - 1))); + EXPECT_EQ(_HOSTLINUX, GetSynFingerOs(FingerSyn(s, sizeof(s) - 1))); } TEST(FingerSyn, testLinuxFastOpen_isLinux) { @@ -64,7 +64,7 @@ TEST(FingerSyn, testLinuxFastOpen_isLinux) { \xd0\x02\xff\xd7\x29\x97\x00\x00\x02\x04\xff\xd7\x04\x02\x08\x0a\ \x43\x3f\x21\xf8\x00\x00\x00\x00\x01\x03\x03\x07\x22\x0a\xd4\x75\ \x4f\x06\xc0\x97\x25\x6c\x01\x01"; - EXPECT_EQ(LINUX, GetSynFingerOs(FingerSyn(s, sizeof(s) - 1))); + EXPECT_EQ(_HOSTLINUX, GetSynFingerOs(FingerSyn(s, sizeof(s) - 1))); } TEST(FingerSyn, testLinuxGceVm_isLinux) { @@ -73,7 +73,7 @@ TEST(FingerSyn, testLinuxGceVm_isLinux) { \x7f\x00\x00\x7c\xd2\xfe\x1b\x58\xf5\xb2\xf6\xca\x00\x00\x00\x00\ \xa0\x02\xff\x28\x16\xe7\x00\x00\x02\x04\x05\x8c\x04\x02\x08\x0a\ \xb6\x4d\x6b\xd8\x00\x00\x00\x00\x01\x03\x03\x07"; - EXPECT_EQ(LINUX, GetSynFingerOs(FingerSyn(s, sizeof(s) - 1))); + EXPECT_EQ(_HOSTLINUX, GetSynFingerOs(FingerSyn(s, sizeof(s) - 1))); } TEST(FingerSyn, testOpenbsd) { @@ -82,7 +82,7 @@ TEST(FingerSyn, testOpenbsd) { \x7f\x00\x00\x7c\xa2\x91\x1b\x58\x53\x54\xbc\xc5\x00\x00\x00\x00\ \xb0\x02\x40\x00\x70\xf7\x00\x00\x02\x04\x05\xb4\x01\x01\x04\x02\ \x01\x03\x03\x06\x01\x01\x08\x0a\xa2\x70\xeb\x7a\x00\x00\x00\x00"; - EXPECT_EQ(OPENBSD, GetSynFingerOs(FingerSyn(s, sizeof(s) - 1))); + EXPECT_EQ(_HOSTOPENBSD, GetSynFingerOs(FingerSyn(s, sizeof(s) - 1))); } TEST(FingerSyn, testXnu) { @@ -91,7 +91,7 @@ TEST(FingerSyn, testXnu) { \x7f\x00\x00\x7c\xd3\x63\x1b\x58\xe6\xd5\xf8\x7e\x00\x00\x00\x00\ \xb0\x02\xff\xff\x70\x36\x00\x00\x02\x04\x05\xb4\x01\x03\x03\x06\ \x01\x01\x08\x0a\x25\x85\xaa\x28\x00\x00\x00\x00\x04\x02\x00\x00"; - EXPECT_EQ(XNU, GetSynFingerOs(FingerSyn(s, sizeof(s) - 1))); + EXPECT_EQ(_HOSTXNU, GetSynFingerOs(FingerSyn(s, sizeof(s) - 1))); } TEST(FingerSyn, testFreebsd12) { @@ -100,7 +100,7 @@ TEST(FingerSyn, testFreebsd12) { \x7f\x00\x00\x7c\xde\x81\x1b\x58\x23\x39\xfc\x6b\x00\x00\x00\x00\ \xa0\x02\xff\xff\x8c\x8c\x00\x00\x02\x04\x05\xb4\x01\x03\x03\x06\ \x04\x02\x08\x0a\x1f\xa1\x59\x46\x00\x00\x00\x00"; - EXPECT_EQ(FREEBSD, GetSynFingerOs(FingerSyn(s, sizeof(s) - 1))); + EXPECT_EQ(_HOSTFREEBSD, GetSynFingerOs(FingerSyn(s, sizeof(s) - 1))); } TEST(FingerSyn, testRedbeanGceVm_isFreebsd) { @@ -109,7 +109,7 @@ TEST(FingerSyn, testRedbeanGceVm_isFreebsd) { \x7f\x00\x00\x7c\x5a\x6e\x1b\x58\x0a\x15\xba\x1a\x00\x00\x00\x00\ \xa0\x02\xff\xff\xe4\x60\x00\x00\x02\x04\x05\x8c\x01\x03\x03\x06\ \x04\x02\x08\x0a\xc9\x06\xb4\x13\x00\x00\x00\x00"; - EXPECT_EQ(FREEBSD, GetSynFingerOs(FingerSyn(s, sizeof(s) - 1))); + EXPECT_EQ(_HOSTFREEBSD, GetSynFingerOs(FingerSyn(s, sizeof(s) - 1))); } TEST(FingerSyn, testNetbsd_isFreebsdSadly) { @@ -118,5 +118,5 @@ TEST(FingerSyn, testNetbsd_isFreebsdSadly) { \x7f\x00\x00\x7c\xfc\x18\x1b\x58\x8e\xb8\x1b\xfe\x00\x00\x00\x00\ \xa0\x02\x80\x00\xdc\xb6\x00\x00\x02\x04\x05\xb4\x01\x03\x03\x03\ \x04\x02\x08\x0a\x00\x00\x00\x01\x00\x00\x00\x00"; - EXPECT_EQ(FREEBSD, GetSynFingerOs(FingerSyn(s, sizeof(s) - 1))); + EXPECT_EQ(_HOSTFREEBSD, GetSynFingerOs(FingerSyn(s, sizeof(s) - 1))); } diff --git a/tool/net/redbean.c b/tool/net/redbean.c index 9a4c0bf32..2978cf151 100644 --- a/tool/net/redbean.c +++ b/tool/net/redbean.c @@ -6624,7 +6624,7 @@ static void MakeExecutableModifiable(void) { int ft; size_t n; extern char ape_rom_vaddr[] __attribute__((__weak__)); - if (!(SUPPORT_VECTOR & (METAL | WINDOWS | XNU))) return; + if (!(SUPPORT_VECTOR & (_HOSTMETAL | _HOSTWINDOWS | _HOSTXNU))) return; if (IsWindows()) return; // TODO if (IsOpenbsd()) return; // TODO if (IsNetbsd()) return; // TODO