mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-02-01 03:53:33 +00:00
45b72485ad
For the first time ever, all tests in this codebase now pass, when run automatically on macos, freebsd, openbsd, rhel5, rhel7, alpine and windows via the network using the runit and runitd build tools - Fix vfork exec path etc. - Add XNU opendir() support - Add OpenBSD opendir() support - Add Linux history to syscalls.sh - Use copy_file_range on FreeBSD 13+ - Fix system calls with 7+ arguments - Fix Windows with greater than 16 FDs - Fix RUNIT.COM and RUNITD.COM flakiness - Fix OpenBSD munmap() when files are mapped - Fix long double so it's actually long on Windows - Fix OpenBSD truncate() and ftruncate() thunk typo - Let Windows fcntl() be used on socket files descriptors - Fix Windows fstat() which had an accidental printf statement - Fix RHEL5 CLOCK_MONOTONIC by not aliasing to CLOCK_MONOTONIC_RAW This is wonderful. I never could have dreamed it would be possible to get it working so well on so many platforms with tiny binaries. Fixes #31 Fixes #25 Fixes #14
88 lines
2.3 KiB
C++
88 lines
2.3 KiB
C++
#define __COSMOPOLITAN__ 1
|
|
|
|
#ifndef __COUNTER__
|
|
#define __COUNTER__ __LINE__
|
|
#endif
|
|
|
|
#if __GNUC__ + 0 < 2
|
|
#undef __GNUC__
|
|
#elif defined(__GNUC__) && defined(SWIG) /* lool */
|
|
#undef __GNUC__
|
|
#elif defined(__GNUC__) && defined(__NVCC__) /* lool */
|
|
#undef __GNUC__
|
|
#elif !defined(__GNUC__) && defined(__APPLE__) /* modesty */
|
|
#define __GNUC__ 4
|
|
#define __GNUC_MINOR__ 2
|
|
#define __GNUC_PATCHLEVEL__ 1
|
|
#elif !defined(__GNUC__) && defined(__TINYC__)
|
|
#define __GNUC__ 2
|
|
#define __GNUC_MINOR__ 0
|
|
#define __GNUC_PATCHLEVEL__ 0
|
|
#endif
|
|
|
|
#if !defined(__x86_64__) && \
|
|
(defined(__amd64__) || (defined(_M_AMD64) && defined(_M_X64)))
|
|
#define __x86_64__ 1
|
|
#elif !defined(__i386__) && ((defined(__i486__) || defined(__i586__) || \
|
|
defined(__i686__) || defined(__i786__)) || \
|
|
_M_IX86 + 0 >= 400)
|
|
#define __i386__ 1
|
|
#elif !defined(__ia16__) && (defined(__MSDOS__) || defined(__BCC__))
|
|
#define __ia16__ 1
|
|
#endif
|
|
#if __ia16__ + __i386__ + __x86_64__ + 0
|
|
#define __x86__ 1
|
|
#endif
|
|
|
|
#ifndef __has_attribute
|
|
#define __has_attribute(x) 0
|
|
#endif
|
|
#ifndef __has_builtin
|
|
#define __has_builtin(x) 0
|
|
#endif
|
|
#ifndef __has_cpp_attribute
|
|
#define __has_cpp_attribute(x) 0
|
|
#endif
|
|
|
|
#ifdef unix
|
|
#undef unix
|
|
#endif
|
|
|
|
#ifdef linux
|
|
#undef linux
|
|
#endif
|
|
|
|
#ifndef __BIGGEST_ALIGNMENT__
|
|
#define __BIGGEST_ALIGNMENT__ 16
|
|
#endif
|
|
|
|
#define BIGPAGESIZE 0x200000
|
|
#define STACKSIZE 0x10000
|
|
#define FRAMESIZE 0x10000 /* 8086 */
|
|
#define PAGESIZE 0x1000 /* i386+ */
|
|
#define BUFSIZ 0x1000 /* best stdio default */
|
|
#define CACHELINE 0x40 /* nexgen32e */
|
|
#define CHAR_BIT 8 /* b/c von neumann */
|
|
#define ARG_MAX 0x8000 /* b/c windows */
|
|
#define PATH_MAX 248 /* b/c win32 apis limit ~248..260 */
|
|
#define NAME_MAX 63 /* b/c dns */
|
|
#define CHILD_MAX 25 /* only if malloc isn't linked */
|
|
#define OPEN_MAX 16 /* only if malloc isn't linked */
|
|
#define ATEXIT_MAX 32 /* only if malloc isn't linked */
|
|
#define NSIG 128 /* it's complicated */
|
|
|
|
#if defined(__LP64__) && !defined(__INT64_TYPE__)
|
|
#include "libc/integral/lp64.inc"
|
|
#endif
|
|
|
|
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
|
#ifdef __STDC__
|
|
#include "libc/integral/c.inc"
|
|
#else
|
|
#define const
|
|
#define volatile
|
|
#endif
|
|
#ifdef __cplusplus
|
|
#include "libc/integral/cxx.inc"
|
|
#endif
|
|
#endif
|