mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 08:12:28 +00:00
Do some work on TurfWar
This commit is contained in:
parent
bc353f454b
commit
05197afca2
12 changed files with 499 additions and 181 deletions
1
third_party/sqlite3/fts3_write.c
vendored
1
third_party/sqlite3/fts3_write.c
vendored
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
/* clang-format off */
|
||||
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "third_party/sqlite3/fts3Int.inc"
|
||||
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3)
|
||||
|
||||
|
|
41
third_party/sqlite3/mutex.internal.h
vendored
Normal file
41
third_party/sqlite3/mutex.internal.h
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
#ifndef COSMOPOLITAN_THIRD_PARTY_SQLITE3_MUTEX_INTERNAL_H_
|
||||
#define COSMOPOLITAN_THIRD_PARTY_SQLITE3_MUTEX_INTERNAL_H_
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
#if !SQLITE_THREADSAFE
|
||||
#define SQLITE_MUTEX_OMIT
|
||||
#endif
|
||||
#if SQLITE_THREADSAFE && !defined(SQLITE_MUTEX_NOOP)
|
||||
#if SQLITE_OS_UNIX
|
||||
#define SQLITE_MUTEX_PTHREADS
|
||||
#elif SQLITE_OS_WIN
|
||||
#define SQLITE_MUTEX_W32
|
||||
#else
|
||||
#define SQLITE_MUTEX_NOOP
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef SQLITE_MUTEX_OMIT
|
||||
/*
|
||||
** If this is a no-op implementation, implement everything as macros.
|
||||
*/
|
||||
#define sqlite3_mutex_alloc(X) ((sqlite3_mutex*)8)
|
||||
#define sqlite3_mutex_free(X)
|
||||
#define sqlite3_mutex_enter(X)
|
||||
#define sqlite3_mutex_try(X) SQLITE_OK
|
||||
#define sqlite3_mutex_leave(X)
|
||||
#define sqlite3_mutex_held(X) ((void)(X), 1)
|
||||
#define sqlite3_mutex_notheld(X) ((void)(X), 1)
|
||||
#define sqlite3MutexAlloc(X) ((sqlite3_mutex*)8)
|
||||
#define sqlite3MutexInit() SQLITE_OK
|
||||
#define sqlite3MutexEnd()
|
||||
#define MUTEX_LOGIC(X)
|
||||
#else
|
||||
#define MUTEX_LOGIC(X) X
|
||||
int sqlite3_mutex_held(sqlite3_mutex*);
|
||||
#endif /* defined(SQLITE_MUTEX_OMIT) */
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_THIRD_PARTY_SQLITE3_MUTEX_INTERNAL_H_ */
|
3
third_party/sqlite3/os_unix.c
vendored
3
third_party/sqlite3/os_unix.c
vendored
|
@ -50,6 +50,9 @@
|
|||
#include "libc/sysv/consts/s.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/calls/struct/timeval.h"
|
||||
#include "third_party/sqlite3/sqlite3.h"
|
||||
#include "third_party/sqlite3/mutex.internal.h"
|
||||
#include "third_party/sqlite3/mutex.internal.h"
|
||||
#include "third_party/sqlite3/sqliteInt.inc"
|
||||
#if SQLITE_OS_UNIX /* This file is used on unix only */
|
||||
|
||||
|
|
2
third_party/sqlite3/pcache1.c
vendored
2
third_party/sqlite3/pcache1.c
vendored
|
@ -80,6 +80,8 @@
|
|||
** show that method (3) with N==100 provides about a 5% performance boost for
|
||||
** common workloads.
|
||||
*/
|
||||
#include "libc/assert.h"
|
||||
#include "third_party/sqlite3/sqlite3.h"
|
||||
#include "third_party/sqlite3/sqliteInt.inc"
|
||||
/* clang-format off */
|
||||
|
||||
|
|
2
third_party/sqlite3/sqlite3.h
vendored
2
third_party/sqlite3/sqlite3.h
vendored
|
@ -7594,10 +7594,8 @@ struct sqlite3_mutex_methods {
|
|||
** the appropriate thing to do. The sqlite3_mutex_notheld()
|
||||
** interface should also return 1 when given a NULL pointer.
|
||||
*/
|
||||
#ifndef NDEBUG
|
||||
SQLITE_API int sqlite3_mutex_held(sqlite3_mutex*);
|
||||
SQLITE_API int sqlite3_mutex_notheld(sqlite3_mutex*);
|
||||
#endif
|
||||
|
||||
/*
|
||||
** CAPI3REF: Mutex Types
|
||||
|
|
6
third_party/sqlite3/sqlite3.mk
vendored
6
third_party/sqlite3/sqlite3.mk
vendored
|
@ -127,14 +127,20 @@ THIRD_PARTY_SQLITE3_FLAGS = \
|
|||
-DSQLITE_ENABLE_JSON1 \
|
||||
-DSQLITE_ENABLE_DESERIALIZE \
|
||||
|
||||
ifeq ($(MODE),dbg)
|
||||
THIRD_PARTY_SQLITE3_CPPFLAGS_DEBUG = -DSQLITE_DEBUG
|
||||
endif
|
||||
|
||||
$(THIRD_PARTY_SQLITE3_A_OBJS): private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
$(THIRD_PARTY_SQLITE3_FLAGS) \
|
||||
$(THIRD_PARTY_SQLITE3_CPPFLAGS_DEBUG) \
|
||||
-DSQLITE_OMIT_UPDATE_HOOK
|
||||
|
||||
$(THIRD_PARTY_SQLITE3_SHELL_OBJS): private \
|
||||
OVERRIDE_CFLAGS += \
|
||||
$(THIRD_PARTY_SQLITE3_FLAGS) \
|
||||
$(THIRD_PARTY_SQLITE3_CPPFLAGS_DEBUG) \
|
||||
-DHAVE_READLINE=0 \
|
||||
-DHAVE_EDITLINE=0 \
|
||||
-DSQLITE_HAVE_ZLIB \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue