asg017 / sqlite-vec

A vector search SQLite extension that runs anywhere!
Apache License 2.0
4.26k stars 135 forks source link

Compile error redefinition of u64 #133

Open sheldonrobinson opened 3 weeks ago

sheldonrobinson commented 3 weeks ago

Redefinition of u64 defined in sqliteInt.h

error: typedef redefinition with different types ('uint64_t' (aka 'unsigned long') vs 'sqlite_uint64' (aka 'unsigned long long'))
 typedef uint64_t u64;

 note: previous definition is here
 typedef sqlite_uint64 u64;         /* 8-byte unsigned integer */

Suggested fix Avoid redefinition of the following types from sqliteInt.h

typedef sqlite_int64 i64;          /* 8-byte signed integer */
typedef sqlite_uint64 u64;         /* 8-byte unsigned integer */
typedef UINT32_TYPE u32;           /* 4-byte unsigned integer */
typedef UINT16_TYPE u16;           /* 2-byte unsigned integer */
typedef INT16_TYPE i16;            /* 2-byte signed integer */
typedef UINT8_TYPE u8;             /* 1-byte unsigned integer */
typedef INT8_TYPE i8;              /* 1-byte signed integer */

which are also defined in sqlite-vec.c

typedef int8_t i8;
typedef uint8_t u8;
typedef int16_t i16;
typedef int32_t i32;
typedef sqlite3_int64 i64;
typedef uint32_t u32;
typedef uint64_t u64;

So defined only

typedef int32_t i32;