Re: [gdal-dev] Hard coded Pi constants

2016-03-04 Thread Tanuj Kumar
Yes, it should be _USE_MATH_DEFINES, my bad. On Fri, Mar 4, 2016 at 12:26 AM, Jan Heckman wrote: > Hi Tanuj, > It is _USE_MATH_DEFINES, not _USE_MATH_CONSTANTS in VC. > My experience is this works AND is needed for math constants in VS2008, > VS2013 and VS2015. VS2015 is the community version, t

Re: [gdal-dev] Hard coded Pi constants

2016-03-03 Thread Mike Toews
This is not just a MSVC issue. M_PI and other constants are not part of the ISO standard, so if you try: $ gcc --std=c99 small_program_with_M_PI.c you will get "error: ‘M_PI’ undeclared" I'm not sure if you can compile GDAL with `--std=c99`, but I don't see any compelling reason to remove #ifndef

Re: [gdal-dev] Hard coded Pi constants

2016-03-03 Thread Jeff McKenna
Hello, Be careful, as many GDAL package maintainers, including myself, run older Visual Studio versions on Windows. Declaring this constant is done in several software projects. It may be considered "ugly", but it sure works. -jeff On 2016-03-03 1:55 PM, Tanuj Kumar wrote: This is with

[gdal-dev] Hard coded Pi constants

2016-03-03 Thread Tanuj Kumar
This is with regard to the bug listed on https://trac.osgeo.org/gdal/ticket/6388 The fix is to remove the hard coded pi constants, but apparently, using M_PI from math.h as it is breaks compilation on Visual Studio http://stackoverflow.com/questions/26065359/m-pi-flagged-as-undeclared-identifier (