mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-29 22:10:27 +00:00
Remove bool from public headers
This commit is contained in:
parent
dffee606cf
commit
1351d3cede
55 changed files with 105 additions and 98 deletions
|
@ -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); \
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/nt/version.h"
|
||||
|
||||
bool(IsAtLeastWindows10)(void) {
|
||||
bool32(IsAtLeastWindows10)(void) {
|
||||
#ifdef __x86_64__
|
||||
return IsAtLeastWindows10();
|
||||
#else
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue