Fix compilation error for redefinition of jsonIsspace (#75)

* Fix compilation error for redefinition of jsonIsspace when including in amalgamation build of sqlite3.c

* Fix redefinition variable jsonIsSpaceX[]

* Add check for SQLITE_AMALGMATION

* Add check for SQLITE_CORE
This commit is contained in:
Sheldon Robinson 2024-08-09 13:26:45 -04:00 committed by GitHub
parent 6cccfae273
commit 6c26399269
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -546,6 +546,7 @@ static f32 distance_hamming(const void *a, const void *b, const void *d) {
return distance_hamming_u8((u8 *)a, (u8 *)b, dimensions / CHAR_BIT); return distance_hamming_u8((u8 *)a, (u8 *)b, dimensions / CHAR_BIT);
} }
#if !defined(SQLITE_CORE) || (defined(SQLITE_AMALGAMATION) && defined(SQLITE_OMIT_JSON))
// from SQLite source: // from SQLite source:
// https://github.com/sqlite/sqlite/blob/a509a90958ddb234d1785ed7801880ccb18b497e/src/json.c#L153 // https://github.com/sqlite/sqlite/blob/a509a90958ddb234d1785ed7801880ccb18b497e/src/json.c#L153
static const char jsonIsSpaceX[] = { static const char jsonIsSpaceX[] = {
@ -563,7 +564,9 @@ static const char jsonIsSpaceX[] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
}; };
#define jsonIsspace(x) (jsonIsSpaceX[(unsigned char)x]) #define jsonIsspace(x) (jsonIsSpaceX[(unsigned char)x])
#endif
typedef void (*vector_cleanup)(void *p); typedef void (*vector_cleanup)(void *p);