Get SQLite to build

* changed headers
* removed redundant declarations
* ran clang-format
* added sqlite3.mk
This commit is contained in:
ahgamut 2021-05-04 20:09:59 +05:30 committed by Justine Tunney
parent 644f290035
commit 919b6fec10
156 changed files with 2847 additions and 6772 deletions

View file

@ -23,13 +23,14 @@
*/
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_JSON1)
#if !defined(SQLITEINT_H)
#include "sqlite3ext.h"
#include "third_party/sqlite3/sqlite3ext.h"
#endif
SQLITE_EXTENSION_INIT1
#include <assert.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include "libc/assert.h"
#include "libc/mem/mem.h"
#include "libc/str/str.h"
#include "third_party/gdtoa/gdtoa.h"
/* clang-format off */
/* Mark a function parameter as unused, to suppress nuisance compiler
** warnings. */
@ -57,11 +58,11 @@ SQLITE_EXTENSION_INIT1
# define safe_isalnum(x) sqlite3Isalnum(x)
# define safe_isxdigit(x) sqlite3Isxdigit(x)
#else
/* Use the standard library for separate compilation */
#include <ctype.h> /* amalgamator: keep */
# define safe_isdigit(x) isdigit((unsigned char)(x))
# define safe_isalnum(x) isalnum((unsigned char)(x))
# define safe_isxdigit(x) isxdigit((unsigned char)(x))
/* Use the standard library for separate compilation */
#include "libc/str/str.h" /* amalgamator: keep */
#define safe_isdigit(x) isdigit((unsigned char)(x))
#define safe_isalnum(x) isalnum((unsigned char)(x))
#define safe_isxdigit(x) isxdigit((unsigned char)(x))
#endif
/*
@ -717,9 +718,9 @@ static int jsonParseAddNode(JsonParse*,u32,u32,const char*);
** inlined.
*/
#if defined(__GNUC__)
# define JSON_NOINLINE __attribute__((noinline))
#elif defined(_MSC_VER) && _MSC_VER>=1310
# define JSON_NOINLINE __declspec(noinline)
#define JSON_NOINLINE __attribute__((__noinline__))
#elif defined(_MSC_VER) && _MSC_VER >= 1310
#define JSON_NOINLINE __declspec(noinline)
#else
# define JSON_NOINLINE
#endif