On 22-6-2014 6:54, Partha Bagchi wrote:
No response? I was going by the standards and using -std=c++11.
Well... 11 hours to respond to an email is not a whole lot. Patience!
Shouldn't the code be standardized?
There is no standardized way of determining what OS you are compiling for. However, _WIN32 seems more common than WIN32. See, e.g. here: http://sourceforge.net/p/predef/wiki/OperatingSystems/
So, we should be able to change all WIN32 to _WIN32 and improve compatibility. The standard Windows build system (btool/build.xml) explicitly defines WIN32 in config.h.
About M_PI, <2geom/angle.h> defines it if it is not already defined. If there are many other constants needed (Liam mentioned sqrt(2)), we could add <geom/constants.h> file to collect all those. Regardless, I think you cannot escape modifying the source code, or temporarily adding the missing defines to the gcc cmdline.
regards, Johan
Thanks, Partha
On Sat, Jun 21, 2014 at 2:16 PM, Partha Bagchi <partha1b@...400... mailto:partha1b@...400...> wrote:
I am having some difficulty with the latest code (also for 0.48.5 series) which I didn't have before or didn't notice before. :) There are lot of places where M_PI and friends is/are used without it/they being in scope. In some files, M_PI is defined right in with #ifndef block. What would be the fastest way (other than modifying the source all over the place) of rectifying this? A lot of the Windows specific stuff is defined with the #ifdef WIN32 block. However, in my case it only works if it's _WIN32 and not WIN32. This of course I can pass on the command line to gcc. Would be nice if it was standard as say glib or gimp. Thanks, Partha