Bug report, and some replies: https://github.com/msys2/MINGW-packages/issues/19036#issuecomment-1797951754
This appears to be a bug. I've documented a simple solution here: C++: error: expected ',' or '...' before string constant before __FILE__ in fancy_abort (__FILE__, __LINE__, __FUNCTION__) when compiling gcc
add MATLAB typecast function