mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-06 03:08:31 +00:00
Further improve fatcosmocc
This commit is contained in:
parent
3f2f0e3a74
commit
ab9a284640
39 changed files with 96 additions and 28 deletions
|
@ -1,6 +1,17 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_ASSERT_H_
|
||||
#define COSMOPOLITAN_LIBC_ASSERT_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
#ifdef _ASSERT_H
|
||||
#undef _ASSERT_H
|
||||
#undef assert
|
||||
#ifdef COSMO
|
||||
#undef unassert
|
||||
#undef npassert
|
||||
#ifndef NDEBUG
|
||||
#undef __assert_macro
|
||||
#endif /* NDEBUG */
|
||||
#endif /* COSMO */
|
||||
#endif /* _ASSERT_H */
|
||||
|
||||
#ifndef _ASSERT_H
|
||||
#define _ASSERT_H
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
void __assert_fail(const char *, const char *, int) relegated;
|
||||
|
@ -11,7 +22,8 @@ void __assert_fail(const char *, const char *, int) relegated;
|
|||
#define assert(x) ((void)((x) || (__assert_fail(#x, __FILE__, __LINE__), 0)))
|
||||
#endif
|
||||
|
||||
#ifndef __cplusplus
|
||||
#if __STDC_VERSION__ >= 201112L && !defined(__cplusplus)
|
||||
#undef static_assert
|
||||
#define static_assert _Static_assert
|
||||
#endif
|
||||
|
||||
|
@ -47,5 +59,4 @@ extern bool __assert_disable;
|
|||
#endif /* COSMO */
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_ASSERT_H_ */
|
||||
#endif /* _ASSERT_H */
|
||||
|
|
|
@ -660,6 +660,8 @@ extern const errno_t EXFULL;
|
|||
|
||||
extern errno_t __errno;
|
||||
errno_t *__errno_location(void) dontthrow pureconst;
|
||||
extern char *program_invocation_short_name;
|
||||
extern char *program_invocation_name;
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/runtime/internal.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
|
||||
__attribute__((__weak__)) void __stack_chk_fail(void) {
|
||||
|
|
|
@ -1,4 +1 @@
|
|||
#ifndef _ASSERT_H
|
||||
#define _ASSERT_H
|
||||
#include "libc/assert.h"
|
||||
#endif /* _ASSERT_H */
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/intrin/safemacros.internal.h"
|
||||
#include "libc/log/internal.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/thread/thread.h"
|
||||
|
||||
/**
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include "libc/sysv/consts/sig.h"
|
||||
#include "libc/thread/thread.h"
|
||||
#include "libc/thread/tls.h"
|
||||
#include "libc/errno.h"
|
||||
#include "third_party/lua/lunix.h"
|
||||
#ifndef __x86_64__
|
||||
|
||||
|
|
|
@ -21,8 +21,6 @@ typedef unsigned long jmp_buf[26];
|
|||
typedef long sigjmp_buf[12];
|
||||
|
||||
extern char **environ;
|
||||
extern char *program_invocation_name;
|
||||
extern char *program_invocation_short_name;
|
||||
|
||||
void mcount(void);
|
||||
int daemon(int, int);
|
||||
|
|
|
@ -19,10 +19,10 @@
|
|||
#include "libc/calls/calls.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/intrin/safemacros.internal.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/o.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/x/x.h"
|
||||
|
||||
/**
|
||||
|
|
|
@ -22,5 +22,6 @@ COSMOPOLITAN_C_END_
|
|||
#define AT_SYMLINK_FOLLOW AT_SYMLINK_FOLLOW
|
||||
#define AT_SYMLINK_NOFOLLOW AT_SYMLINK_NOFOLLOW
|
||||
#define AT_REMOVEDIR AT_REMOVEDIR
|
||||
#define AT_EACCESS AT_EACCESS
|
||||
|
||||
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_AT_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue