Further improve fatcosmocc

This commit is contained in:
Justine Tunney 2023-08-13 01:44:39 -07:00
parent 3f2f0e3a74
commit ab9a284640
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
39 changed files with 96 additions and 28 deletions

View file

@ -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 */

View file

@ -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) */

View file

@ -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) {

View file

@ -1,4 +1 @@
#ifndef _ASSERT_H
#define _ASSERT_H
#include "libc/assert.h"
#endif /* _ASSERT_H */

View file

@ -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"
/**

View file

@ -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__

View file

@ -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);

View file

@ -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"
/**

View file

@ -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_ */