sqlite-vec
sqlite-vec copied to clipboard
PORTABLE_ALIGN<x> should use __declspec on MSVC
https://github.com/asg017/sqlite-vec/blob/ee3654701f7b8efe4802ff1caed24514f43443dd/sqlite-vec.c#L119-L122
Currently this causes SQLITE_VEC_ENABLE_AVX to fail with MSVC
prolly should be something like:
#ifdef SQLITE_VEC_ENABLE_AVX
#include <immintrin.h>
#ifdef _MSC_VER // Visual Studio
#define PORTABLE_ALIGN32 __declspec(align(32))
#define PORTABLE_ALIGN64 __declspec(align(64))
#else
#define PORTABLE_ALIGN32 __attribute__((aligned(32)))
#define PORTABLE_ALIGN64 __attribute__((aligned(64)))
#endif
(this compiles on my computer with MSVC, and seems to function correctly with my dataset)
Or more elifdefs for other compilers I'm not aware of
I can submit PR if this fix is acceptable, or suggestions provided