This definition seems innocuous to me and the line is part of a math constant definition file included in a C++ library that compiles without trouble under Windows VC++17 and Linux g++/c++17.
The error however comes during a GCC compilation controlled by Cython. Cython is a tool to wrap C/C++ code so that it can interface with a Python interpreter. Cython generates the wrapping code and sends it to GCC. It is a bit of a black box to me so I am not sure why I am getting an error now.
Yes, that's exactly what I found.
It is defined in <cmath>. Previously I had #define _USE_MATH_DEFINE in my code to get those definitions but that doesn't work in Visual Studio. So to make my code portable I had remove the #define _USE_MATH_DEFINE and instead created this const definition file. For some reason, however the macros contunue to be defined; not sure why.
It works just fine in VS. The problem is when the #define is encountered, which is often before you think it is.
Make sure that the very first line of your file, before any #includes, says #define _USE_MATH_DEFINES (note the āSā on the end of that).
Unless you specify a specific standard, compilers will tend to include the math defines like M_PI. By providing the #define you override the standards-compliant behavior caused by -std=c++17. I suspect your invocation of cl did not specify a specific standard, and so it was not an issue.