g++ 5.4.0 under cygwin will successfully compile programs with M_PI with no parameters.
However, with -std=c++11 it will give an error.
This question: How to use the PI constant in C++
implies that older machines might need to define
#define _USE_MATH_DEFINES
#include <math.h>
But in fact no one should be including math.h, now it should be
#include <cmath>
What is the standard, what should it be? On my ubuntu, with a much older g++ 4.8.4 it compiles fine.
It is utterly ridiculous that each programmer should define
const double pi = 3.14159265358979;
for themselves.