RWKV / rwkv.cpp

INT4/INT5/INT8 and FP16 inference on CPU for RWKV language model
MIT License
1.37k stars 90 forks source link

Fix build on non-MSVC compilers for Windows platforms #94

Closed LoganDark closed 1 year ago

LoganDark commented 1 year ago

@LostRuins was having this issue using mingw to compile rwkv.cpp.

The issue was that mingw doesn't report MSVC defines & doesn't even declare the fstat family of functions unless sys/stat.h is included.

So I moved that include out of the Linux specific section and also tried to detect Windows platforms in general rather than only MSVC.

Maybe this would also fix using MSVC on non-windows platforms, idk. (Does MSVC even exist on other platforms?)