[gdal-dev] Hard coded Pi constants

Tanuj Kumar kmrtnjscnc at gmail.com
Fri Mar 4 05:20:10 PST 2016


Yes, it should be _USE_MATH_DEFINES, my bad.

On Fri, Mar 4, 2016 at 12:26 AM, Jan Heckman <jan.heckman at gmail.com> 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, the others are prof
> versions, but that should not make aucune difference, of course.
> Jan
>
> On Thu, Mar 3, 2016 at 6:55 PM, Tanuj Kumar <kmrtnjscnc at gmail.com> wrote:
>
>> 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
>> (I haven't checked it yet myself; that would need me to switch to windows,
>> and I'm on linux right now)
>>
>> However, we could also declare #define _USE_MATH_CONSTANTS, and then use
>> M_PI without declaring it(And not just M_PI, all the other math constants
>> listed on https://msdn.microsoft.com/en-us/library/4hwaceh6.aspx).
>>
>> Could someone please check whether math constants work in later versions
>> of visual studio(Both with and without #define _USE_MATH_CONSTANTS)?
>>
>> Thank you
>> Tanuj
>>
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20160304/1b8647d2/attachment.html>


More information about the gdal-dev mailing list