mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-18 00:20:30 +00:00
parent
446a1f7c5a
commit
06f9a5b627
34 changed files with 115 additions and 51 deletions
1
third_party/libcxx/__config
vendored
1
third_party/libcxx/__config
vendored
|
@ -16,6 +16,7 @@
|
|||
#define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
|
||||
#define _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS
|
||||
#define _LIBCPP_HAS_TRIVIAL_MUTEX_DESTRUCTION
|
||||
#define _LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__clang__)
|
||||
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
|
|
8
third_party/libcxx/algorithm.cc
vendored
8
third_party/libcxx/algorithm.cc
vendored
|
@ -55,8 +55,10 @@ template unsigned __sort5<__less<long double>&, long double*>(long double*, long
|
|||
#ifndef _LIBCPP_HAS_NO_THREADS
|
||||
_LIBCPP_SAFE_STATIC static __libcpp_mutex_t __rs_mut = _LIBCPP_MUTEX_INITIALIZER;
|
||||
#endif
|
||||
unsigned __rs_default::__c_ = 0;
|
||||
|
||||
#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE) \
|
||||
|| defined(_LIBCPP_BUILDING_LIBRARY)
|
||||
unsigned __rs_default::__c_ = 0;
|
||||
__rs_default::__rs_default()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_THREADS
|
||||
|
@ -64,12 +66,10 @@ __rs_default::__rs_default()
|
|||
#endif
|
||||
__c_ = 1;
|
||||
}
|
||||
|
||||
__rs_default::__rs_default(const __rs_default&)
|
||||
{
|
||||
++__c_;
|
||||
}
|
||||
|
||||
__rs_default::~__rs_default()
|
||||
{
|
||||
#ifndef _LIBCPP_HAS_NO_THREADS
|
||||
|
@ -79,13 +79,13 @@ __rs_default::~__rs_default()
|
|||
--__c_;
|
||||
#endif
|
||||
}
|
||||
|
||||
__rs_default::result_type
|
||||
__rs_default::operator()()
|
||||
{
|
||||
static mt19937 __rs_g;
|
||||
return __rs_g();
|
||||
}
|
||||
#endif
|
||||
|
||||
__rs_default
|
||||
__rs_get()
|
||||
|
|
8
third_party/libcxx/exception_fallback.hh
vendored
8
third_party/libcxx/exception_fallback.hh
vendored
|
@ -14,23 +14,25 @@
|
|||
namespace std {
|
||||
|
||||
_LIBCPP_SAFE_STATIC static std::terminate_handler __terminate_handler;
|
||||
_LIBCPP_SAFE_STATIC static std::unexpected_handler __unexpected_handler;
|
||||
|
||||
#if _LIBCPP_STD_VER <= 14 || \
|
||||
defined(_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS) || \
|
||||
defined(_LIBCPP_BUILDING_LIBRARY)
|
||||
_LIBCPP_SAFE_STATIC static std::unexpected_handler __unexpected_handler;
|
||||
// libcxxrt provides implementations of these functions itself.
|
||||
unexpected_handler set_unexpected(unexpected_handler func) _NOEXCEPT {
|
||||
return __libcpp_atomic_exchange(&__unexpected_handler, func);
|
||||
}
|
||||
|
||||
unexpected_handler get_unexpected() _NOEXCEPT {
|
||||
return __libcpp_atomic_load(&__unexpected_handler);
|
||||
}
|
||||
|
||||
_LIBCPP_NORETURN
|
||||
void unexpected() {
|
||||
(*get_unexpected())();
|
||||
// unexpected handler should not return
|
||||
terminate();
|
||||
}
|
||||
#endif
|
||||
|
||||
terminate_handler set_terminate(terminate_handler func) _NOEXCEPT {
|
||||
return __libcpp_atomic_exchange(&__terminate_handler, func);
|
||||
|
|
10
third_party/make/read.c
vendored
10
third_party/make/read.c
vendored
|
@ -427,7 +427,9 @@ eval_makefile (const char *filename, unsigned short flags)
|
|||
fclose (ebuf.fp);
|
||||
|
||||
free (ebuf.bufstart);
|
||||
alloca (0);
|
||||
|
||||
/* [jart] breaks gcc11 (also wat) */
|
||||
void *volatile wat = alloca (0);
|
||||
|
||||
errno = 0;
|
||||
return deps;
|
||||
|
@ -469,7 +471,8 @@ eval_buffer (char *buffer, const floc *flocp)
|
|||
|
||||
reading_file = curfile;
|
||||
|
||||
alloca (0);
|
||||
/* [jart] breaks gcc11 (also wat) */
|
||||
void *volatile wat = alloca (0);
|
||||
}
|
||||
|
||||
/* Check LINE to see if it's a variable assignment or undefine.
|
||||
|
@ -2495,7 +2498,8 @@ find_percent_cached (const char **string)
|
|||
if (! new)
|
||||
{
|
||||
slen = strlen (*string);
|
||||
new = alloca (slen + 1);
|
||||
/* [jart] can't prove alloca() isn't returned; let's just leak */
|
||||
new = malloc (slen + 1);
|
||||
memcpy (new, *string, slen + 1);
|
||||
p = new + (p - *string);
|
||||
*string = new;
|
||||
|
|
2
third_party/make/remake.c
vendored
2
third_party/make/remake.c
vendored
|
@ -322,7 +322,7 @@ update_file (struct file *file, unsigned int depth)
|
|||
check_renamed (f);
|
||||
|
||||
/* Clean up any alloca() used during the update. */
|
||||
alloca (0);
|
||||
void *volatile wat = alloca (0);
|
||||
|
||||
/* If we got an error, don't bother with double_colon etc. */
|
||||
if (new && !keep_going_flag)
|
||||
|
|
4
third_party/mbedtls/bigmul4.c
vendored
4
third_party/mbedtls/bigmul4.c
vendored
|
@ -29,7 +29,7 @@
|
|||
* @note words are host endian while array is little endian
|
||||
* @mayalias
|
||||
*/
|
||||
void (*Mul4x4)(uint64_t C[8], const uint64_t A[4], const uint64_t B[4]);
|
||||
void (*Mul4x4)(uint64_t C[16], const uint64_t A[8], const uint64_t B[8]);
|
||||
|
||||
static textstartup void Mul4x4Init()
|
||||
{
|
||||
|
@ -38,7 +38,7 @@ static textstartup void Mul4x4Init()
|
|||
|
||||
const void *const Mul4x4Ctor[] initarray = {Mul4x4Init};
|
||||
|
||||
void Mul4x4Pure(uint64_t C[8], const uint64_t A[4], const uint64_t B[4])
|
||||
void Mul4x4Pure(uint64_t C[16], const uint64_t A[8], const uint64_t B[8])
|
||||
{
|
||||
uint128_t t;
|
||||
uint64_t h, c1, c2, c3;
|
||||
|
|
2
third_party/mbedtls/test/test_suite_ssl.c
vendored
2
third_party/mbedtls/test/test_suite_ssl.c
vendored
|
@ -2699,7 +2699,7 @@ void test_ssl_message_queue_insufficient_buffer_wrapper( void ** params )
|
|||
void test_ssl_message_mock_uninitialized( )
|
||||
{
|
||||
enum { MSGLEN = 10 };
|
||||
unsigned char message[MSGLEN], received[MSGLEN];
|
||||
unsigned char message[MSGLEN] = {0}, received[MSGLEN];
|
||||
mbedtls_mock_socket client, server;
|
||||
mbedtls_test_message_queue server_queue, client_queue;
|
||||
mbedtls_test_message_socket_context server_context, client_context;
|
||||
|
|
|
@ -38,6 +38,10 @@
|
|||
#include "third_party/python/Modules/_decimal/libmpdec/typearith.h"
|
||||
/* clang-format off */
|
||||
|
||||
#if __GNUC__ >= 11
|
||||
#pragma GCC diagnostic ignored "-Wmisleading-indentation"
|
||||
#endif
|
||||
|
||||
asm(".ident\t\"\\n\\n\
|
||||
libmpdec (BSD-2)\\n\
|
||||
Copyright 2008-2016 Stefan Krah\"");
|
||||
|
|
|
@ -90,7 +90,7 @@ NS(XmlInitEncoding)(INIT_ENCODING *p, const ENCODING **encPtr,
|
|||
static const ENCODING *
|
||||
NS(findEncoding)(const ENCODING *enc, const char *ptr, const char *end) {
|
||||
# define ENCODING_MAX 128
|
||||
char buf[ENCODING_MAX];
|
||||
char buf[ENCODING_MAX] = {0}; /* [jart] wut */
|
||||
char *p = buf;
|
||||
int i;
|
||||
XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1);
|
||||
|
|
6
third_party/sqlite3/build.c
vendored
6
third_party/sqlite3/build.c
vendored
|
@ -24,6 +24,10 @@
|
|||
*/
|
||||
#include "third_party/sqlite3/sqliteInt.inc"
|
||||
|
||||
#if __GNUC__ >= 11
|
||||
#pragma GCC diagnostic ignored "-Wmisleading-indentation"
|
||||
#endif
|
||||
|
||||
/* clang-format off */
|
||||
|
||||
#ifndef SQLITE_OMIT_SHARED_CACHE
|
||||
|
@ -4230,7 +4234,7 @@ void sqlite3DefaultRowEst(Index *pIdx){
|
|||
if( x<99 ){
|
||||
pIdx->pTable->nRowLogEst = x = 99;
|
||||
}
|
||||
if( pIdx->pPartIdxWhere!=0 ) x -= 10; assert( 10==sqlite3LogEst(2) );
|
||||
if( pIdx->pPartIdxWhere!=0 ) x -= 10; /*assert( 10==sqlite3LogEst(2) );*/
|
||||
a[0] = x;
|
||||
|
||||
/* Estimate that a[1] is 10, a[2] is 9, a[3] is 8, a[4] is 7, a[5] is
|
||||
|
|
5
third_party/sqlite3/fts5.c
vendored
5
third_party/sqlite3/fts5.c
vendored
|
@ -14170,10 +14170,13 @@ static int sqlite3Fts5IndexQuery(
|
|||
/* If the QUERY_SCAN flag is set, all other flags must be clear. */
|
||||
assert( (flags & FTS5INDEX_QUERY_SCAN)==0 || flags==FTS5INDEX_QUERY_SCAN );
|
||||
|
||||
/* [jart] what is with these gcc11 warnings */
|
||||
void *MemCpy(void *, const void *, size_t) asm("memcpy");
|
||||
|
||||
if( sqlite3Fts5BufferSize(&p->rc, &buf, nToken+1)==0 ){
|
||||
int iIdx = 0; /* Index to search */
|
||||
int iPrefixIdx = 0; /* +1 prefix index */
|
||||
if( nToken ) memcpy(&buf.p[1], pToken, nToken);
|
||||
if( nToken ) MemCpy(&buf.p[1], pToken, nToken);
|
||||
|
||||
/* Figure out which index to search and set iIdx accordingly. If this
|
||||
** is a prefix query for which there is no prefix index, set iIdx to
|
||||
|
|
4
third_party/sqlite3/where.c
vendored
4
third_party/sqlite3/where.c
vendored
|
@ -20,6 +20,10 @@
|
|||
#include "third_party/sqlite3/whereInt.inc"
|
||||
/* clang-format off */
|
||||
|
||||
#if __GNUC__ >= 11
|
||||
#pragma GCC diagnostic ignored "-Wmisleading-indentation"
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Extra information appended to the end of sqlite3_index_info but not
|
||||
** visible to the xBestIndex function, at least not directly. The
|
||||
|
|
2
third_party/tidy/access.c
vendored
2
third_party/tidy/access.c
vendored
|
@ -891,7 +891,7 @@ static Bool CompareColors( const int rgbBG[3], const int rgbFG[3] )
|
|||
* blue = 5.
|
||||
*********************************************************************/
|
||||
|
||||
static Bool GetRgb( ctmbstr color, int rgb[] )
|
||||
static Bool GetRgb( ctmbstr color, int rgb[3] )
|
||||
{
|
||||
uint x;
|
||||
|
||||
|
|
4
third_party/tidy/attrs.c
vendored
4
third_party/tidy/attrs.c
vendored
|
@ -14,6 +14,10 @@
|
|||
#include "libc/fmt/fmt.h"
|
||||
#include "third_party/tidy/utf8.h"
|
||||
|
||||
#if __GNUC__ >= 11 /* [jart] this one looks legit */
|
||||
#pragma GCC diagnostic ignored "-Wmisleading-indentation"
|
||||
#endif
|
||||
|
||||
/*
|
||||
Bind attribute types to procedures to check values.
|
||||
You can add new procedures for better validation
|
||||
|
|
4
third_party/unzip/unzip.c
vendored
4
third_party/unzip/unzip.c
vendored
|
@ -75,6 +75,10 @@
|
|||
#include "third_party/unzip/unzvers.h"
|
||||
#include "third_party/unzip/globals.h"
|
||||
|
||||
#if __GNUC__ >= 11 /* [jart] worth looking into */
|
||||
#pragma GCC diagnostic ignored "-Wrestrict"
|
||||
#endif
|
||||
|
||||
#ifndef WINDLL /* The WINDLL port uses windll/windll.c instead... */
|
||||
|
||||
/***************************/
|
||||
|
|
4
third_party/unzip/unzip.mk
vendored
4
third_party/unzip/unzip.mk
vendored
|
@ -59,6 +59,10 @@ $(THIRD_PARTY_UNZIP_A_OBJS): private \
|
|||
-DHAVE_TERMIOS_H \
|
||||
-DNO_LCHMOD
|
||||
|
||||
$(THIRD_PARTY_UNZIP_A_OBJS): private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
$(OLD_CODE)
|
||||
|
||||
THIRD_PARTY_UNZIP_COMS = o/$(MODE)/third_party/unzip/unzip.com
|
||||
THIRD_PARTY_UNZIP_BINS = $(THIRD_PARTY_UNZIP_COMS) $(THIRD_PARTY_UNZIP_COMS:%=%.dbg)
|
||||
THIRD_PARTY_UNZIP_LIBS = $(foreach x,$(THIRD_PARTY_UNZIP_ARTIFACTS),$($(x)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue