[Proj] [MS Windows] PVALUE causes problems with mingw64compilers
sisyphus1 at optusnet.com.au
sisyphus1 at optusnet.com.au
Mon May 25 16:59:30 PDT 2015
-----Original Message-----
From: Howard Butler
Sent: Thursday, May 21, 2015 10:43 PM
To: PROJ.4 and general Projections Discussions
Subject: Re: [Proj] [MS Windows] PVALUE causes problems with
mingw64compilers
>> On May 21, 2015, at 5:04 AM, sisyphus1 at optusnet.com.au wrote:
>>
>>
>> Is it worth going to the trouble of changing the PVALUE symbol to (say)
>> PROJVALUE for mingw compilers only - but letting the PVALUE symbol stand
>> with non-mingw compilers:
>
> I don’t think so. I think it should just be changed. The folks using
> projects.h have known it was a bit sketchy to be using (we tried to take
> it away once already). The next windows person using proj.4 with an
> interesting include scenario will run into again if we monkey patch the
> mingw case only.
>
> Let’s just rename it, unless someone has a strong objection.
Renaming it is *definitely* my preferred option.
However, following on from an idea presented by David Mertens on the
pdl-devel mailing list, I do have a slight refinement to the above idea of
allowing 2 symbols.
Change:
typedef union { double f; int i; char *s; } PVALUE;
to something like:
typedef union { double f; int i; char *s; } PROJVALUE;
and then insert:
/* The following is for backwards compatibility. */
/* PVALUE is deprecated - use PROJVALUE */
#ifndef _WINREG_ /* _WINREG_ is defined by winreg.h */
#define PVALUE PROJVALUE
#endif
And then, in the proj source, replace all other instances of PVALUE with
PROJVALUE.
Also document PVALUE as being deprecated and will be removed in a future
release.
The only problem is that it still enables someone to write source code that
uses PVALUE - and that source code therefore does not run on Windows if
winreg.h is included.
But, if PVALUE is documented as being deprecated, we presumably open the
door to being able to remove it at a future date (without being accused of
doing something we shouldn't do).
In the meantime it's unlikely that anyone will be inconvenienced.
Cheers,
Rob
More information about the Proj
mailing list