mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 23:08:31 +00:00
Reduce header complexity
- Remove most __ASSEMBLER__ __LINKER__ ifdefs - Rename libc/intrin/bits.h to libc/serialize.h - Block pthread cancelation in fchmodat() polyfill - Remove `clang-format off` statements in third_party
This commit is contained in:
parent
96f979dfc5
commit
fa20edc44d
3057 changed files with 410 additions and 4398 deletions
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/fmt/itoa.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "net/finger/finger.h"
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#ifndef COSMOPOLITAN_NET_FINGER_FINGER_H_
|
||||
#define COSMOPOLITAN_NET_FINGER_FINGER_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
char *DescribeSyn(char *, size_t, const char *, size_t);
|
||||
|
@ -9,5 +8,4 @@ int GetSynFingerOs(uint32_t);
|
|||
uint32_t FingerSyn(const char *, size_t);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_NET_FINGER_FINGER_H_ */
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#define kControlC0 2
|
||||
#define kControlC1 4
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
extern const char kEscapeAuthority[256];
|
||||
|
@ -40,5 +39,4 @@ char *EncodeBase64(const char *, size_t, size_t *);
|
|||
char *DecodeBase64(const char *, size_t, size_t *);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_NET_HTTP_ESCAPE_H_ */
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/assert.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/intrin/bswap.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/str/str.h"
|
||||
|
|
|
@ -148,7 +148,6 @@
|
|||
#define kHttpCdnLoop 92
|
||||
#define kHttpHeadersMax 93
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
struct HttpSlice {
|
||||
|
@ -217,5 +216,4 @@ bool IsNoCompressExt(const char *, size_t);
|
|||
char *FoldHeader(struct HttpMessage *, const char *, int, size_t *);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_HTTP_HTTP_H_ */
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
#define kIpFuture 18
|
||||
#define kIpAnonymous 19
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
struct Cidr {
|
||||
|
@ -49,5 +48,4 @@ const char *GetIpCategoryName(int);
|
|||
bool IsCloudflareIp(uint32_t);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_NET_HTTP_IP_H_ */
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/intrin/bswap.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/str/str.h"
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/time/time.h"
|
||||
#include "net/http/http.h"
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/assert.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/limits.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/mem/alg.h"
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#ifndef COSMOPOLITAN_NET_HTTP_TOKENBUCKET_H_
|
||||
#define COSMOPOLITAN_NET_HTTP_TOKENBUCKET_H_
|
||||
#include "libc/atomic.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
void ReplenishTokens(atomic_uint_fast64_t *, size_t);
|
||||
|
@ -9,5 +8,4 @@ int AcquireToken(atomic_schar *, uint32_t, int);
|
|||
int CountTokens(atomic_schar *, uint32_t, int);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_NET_HTTP_TOKENBUCKET_H_ */
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#define kUrlLatin1 2
|
||||
#define kUrlOpaque 4
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
struct UrlView {
|
||||
|
@ -39,5 +38,4 @@ char *ParseHost(const char *, size_t, struct Url *);
|
|||
char *EscapeUrlView(char *, struct UrlView *, const char[256]);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_NET_HTTP_URL_H_ */
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "net/https/https.h"
|
||||
|
||||
bool CertHasIp(const mbedtls_x509_crt *cert, uint32_t ip) {
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#include "third_party/mbedtls/pk.h"
|
||||
#include "third_party/mbedtls/ssl_ciphersuites.h"
|
||||
#include "third_party/mbedtls/x509_crt.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
struct Cert {
|
||||
|
@ -40,5 +39,4 @@ struct Cert FinishCertificate(struct Cert *, mbedtls_x509write_cert *,
|
|||
mbedtls_pk_context *);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_NET_HTTPS_HTTPS_H_ */
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/sock/sock.h"
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include "libc/errno.h"
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/fmt/itoa.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/intrin/safemacros.internal.h"
|
||||
#include "libc/mem/mem.h"
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#include "libc/fmt/conv.h"
|
||||
#include "libc/fmt/itoa.h"
|
||||
#include "libc/intrin/atomic.h"
|
||||
#include "libc/intrin/bits.h"
|
||||
#include "libc/serialize.h"
|
||||
#include "libc/intrin/bsr.h"
|
||||
#include "libc/intrin/hilbert.h"
|
||||
#include "libc/intrin/kprintf.h"
|
||||
|
@ -311,7 +311,7 @@ struct Worker {
|
|||
atomic_int shutdown;
|
||||
atomic_int connected;
|
||||
struct timespec startread;
|
||||
} * g_worker;
|
||||
} *g_worker;
|
||||
|
||||
// recentworker wakeup
|
||||
struct Recent {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue