Remove bool from public headers

This commit is contained in:
Justine Tunney 2023-11-15 20:57:18 -08:00
parent dffee606cf
commit 1351d3cede
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
55 changed files with 105 additions and 98 deletions

View file

@ -7,7 +7,7 @@ COSMOPOLITAN_C_START_
#if defined(__GNUC__) && !defined(__STRICT_ANSI__) && defined(__x86__)
#define _cmpxchg(IFTHING, ISEQUALTOME, REPLACEITWITHME) \
({ \
bool DidIt; \
bool32 DidIt; \
autotype(IFTHING) IfThing = (IFTHING); \
typeof(*IfThing) IsEqualToMe = (ISEQUALTOME); \
typeof(*IfThing) ReplaceItWithMe = (REPLACEITWITHME); \

View file

@ -25,7 +25,7 @@
* @param z ensures it starts with zero
* @return pointer to nul byte
*/
char *FormatOctal32(char p[hasatleast 13], uint32_t x, bool z) {
char *FormatOctal32(char p[hasatleast 13], uint32_t x, bool32 z) {
char t;
size_t i, a, b;
i = 0;

View file

@ -18,7 +18,7 @@
*/
#include "libc/nt/version.h"
bool(IsAtLeastWindows10)(void) {
bool32(IsAtLeastWindows10)(void) {
#ifdef __x86_64__
return IsAtLeastWindows10();
#else

View file

@ -19,6 +19,6 @@
#include "libc/runtime/runtime.h"
#include "libc/str/str.h"
bool IsCygwin(void) {
bool32 IsCygwin(void) {
return IsGenuineBlink() && !strcmp(GetCpuidOs(), "Cygwin");
}

View file

@ -44,7 +44,7 @@ static textwindows bool IsBeingDebugged(void) {
* Determines if gdb, strace, windbg, etc. is controlling process.
* @return non-zero if attached, otherwise 0
*/
int IsDebuggerPresent(bool force) {
bool32 IsDebuggerPresent(bool32 force) {
/* asan runtime depends on this function */
ssize_t got;
int e, fd, res;

View file

@ -20,6 +20,6 @@
#include "libc/runtime/runtime.h"
#include "libc/str/str.h"
bool IsGenuineBlink(void) {
bool32 IsGenuineBlink(void) {
return X86_HAVE(HYPERVISOR) && !strcmp(GetCpuidEmulator(), "GenuineBlink");
}

View file

@ -21,12 +21,12 @@
#include "libc/log/log.h"
#include "libc/runtime/runtime.h"
bool g_isrunningundermake;
bool32 g_isrunningundermake;
/**
* Returns true if current process was spawned by GNU Make.
*/
bool IsRunningUnderMake(void) {
bool32 IsRunningUnderMake(void) {
return g_isrunningundermake;
}

View file

@ -25,4 +25,4 @@
* server is a good idea since it'll ask the C runtime to not pull
* magical stunts like attaching GDB to the process on crash.
*/
bool __isworker;
bool32 __isworker;

View file

@ -204,7 +204,7 @@ privileged static bool kismapped(int x) {
}
}
privileged bool kisdangerous(const void *p) {
privileged bool32 kisdangerous(const void *p) {
int frame;
if (kisimagepointer(p)) return false;
if (kiskernelpointer(p)) return false;

View file

@ -21,7 +21,7 @@ size_t ksnprintf(char *, size_t, const char *, ...);
void kvprintf(const char *, va_list);
size_t kvsnprintf(char *, size_t, const char *, va_list);
bool kisdangerous(const void *);
bool32 kisdangerous(const void *);
void klog(const char *, size_t);
void _klog_serial(const char *, size_t);
@ -31,26 +31,26 @@ void uprintf(const char *, ...);
void uvprintf(const char *, va_list);
#ifndef TINY
#define KINFOF(FMT, ...) \
do { \
uprintf("\r\e[35m%s:%d: " FMT "\e[0m\n", \
__FILE__, __LINE__, ## __VA_ARGS__); \
} while (0)
#define KWARNF(FMT, ...) \
do { \
uprintf("\r\e[94;49mwarn: %s:%d: " FMT "\e[0m\n", \
__FILE__, __LINE__, ## __VA_ARGS__); \
} while (0)
#define KINFOF(FMT, ...) \
do { \
uprintf("\r\e[35m%s:%d: " FMT "\e[0m\n", __FILE__, __LINE__, \
##__VA_ARGS__); \
} while (0)
#define KWARNF(FMT, ...) \
do { \
uprintf("\r\e[94;49mwarn: %s:%d: " FMT "\e[0m\n", __FILE__, __LINE__, \
##__VA_ARGS__); \
} while (0)
#else
#define KINFOF(FMT, ...) ((void)0)
#define KWARNF(FMT, ...) ((void)0)
#endif
#define KDIEF(FMT, ...) \
do { \
kprintf("\r\e[30;101mfatal: %s:%d: " FMT "\e[0m\n", \
__FILE__, __LINE__, ## __VA_ARGS__); \
for (;;) asm volatile("cli\n\thlt"); \
} while (0)
#define KDIEF(FMT, ...) \
do { \
kprintf("\r\e[30;101mfatal: %s:%d: " FMT "\e[0m\n", __FILE__, __LINE__, \
##__VA_ARGS__); \
for (;;) asm volatile("cli\n\thlt"); \
} while (0)
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */