From 85cf4153972c2848831655bafd57cb5e03c5b20d Mon Sep 17 00:00:00 2001 From: Alex Garcia Date: Tue, 31 Mar 2026 12:57:06 -0700 Subject: [PATCH] Remove dead typedef macros and harmful u_int*_t redefinitions The UINT32_TYPE/UINT16_TYPE/INT16_TYPE/UINT8_TYPE/INT8_TYPE/LONGDOUBLE_TYPE macros (copied from sqlite3.c) were never used anywhere in sqlite-vec. The u_int8_t/u_int16_t/u_int64_t typedefs redefined standard types using BSD-only types despite already being included, breaking builds on musl/Alpine, strict C99, and requiring reactive platform guards. Co-Authored-By: Claude Opus 4.6 (1M context) --- sqlite-vec.c | 51 --------------------------------------------------- 1 file changed, 51 deletions(-) diff --git a/sqlite-vec.c b/sqlite-vec.c index abdafe0..e4cfbc1 100644 --- a/sqlite-vec.c +++ b/sqlite-vec.c @@ -22,61 +22,10 @@ SQLITE_EXTENSION_INIT1 #include "sqlite3.h" #endif -#ifndef UINT32_TYPE -#ifdef HAVE_UINT32_T -#define UINT32_TYPE uint32_t -#else -#define UINT32_TYPE unsigned int -#endif -#endif -#ifndef UINT16_TYPE -#ifdef HAVE_UINT16_T -#define UINT16_TYPE uint16_t -#else -#define UINT16_TYPE unsigned short int -#endif -#endif -#ifndef INT16_TYPE -#ifdef HAVE_INT16_T -#define INT16_TYPE int16_t -#else -#define INT16_TYPE short int -#endif -#endif -#ifndef UINT8_TYPE -#ifdef HAVE_UINT8_T -#define UINT8_TYPE uint8_t -#else -#define UINT8_TYPE unsigned char -#endif -#endif -#ifndef INT8_TYPE -#ifdef HAVE_INT8_T -#define INT8_TYPE int8_t -#else -#define INT8_TYPE signed char -#endif -#endif -#ifndef LONGDOUBLE_TYPE -#define LONGDOUBLE_TYPE long double -#endif - #ifndef SQLITE_VEC_ENABLE_DISKANN #define SQLITE_VEC_ENABLE_DISKANN 1 #endif -#ifndef _WIN32 -#ifndef __EMSCRIPTEN__ -#ifndef __COSMOPOLITAN__ -#ifndef __wasi__ -typedef u_int8_t uint8_t; -typedef u_int16_t uint16_t; -typedef u_int64_t uint64_t; -#endif -#endif -#endif -#endif - typedef int8_t i8; typedef uint8_t u8; typedef int16_t i16;