[Proj] [MS Windows] PVALUE causes problems with mingw64compilers

sisyphus1 at optusnet.com.au sisyphus1 at optusnet.com.au
Thu May 21 03:04:48 PDT 2015


-----Original Message----- 
From: Even Rouault
Sent: Wednesday, May 20, 2015 4:03 AM
To: proj at lists.maptools.org
Subject: Re: [Proj] [MS Windows] PVALUE causes problems with
mingw64compilers

> Le mardi 19 mai 2015 19:03:01, Howard Butler a écrit :
>>> On May 19, 2015, at 3:46 AM, sisyphus1 at optusnet.com.au wrote:

>>> Is there any other way I can create a user id ?
>>
>> The https://www.osgeo.org/cgi-bin/ldap_create_user.py page is up for me
>> at
>> this time.

Still not working with IE, but works fine on Ubuntu using Firefox.

>> I have created a ticket with this issue at
>> http://trac.osgeo.org/proj/ticket/273 but I do not know if it is
>> practical
>> to change this union name from PVALUE to something else in what is
>> essentially a public header.

Damn ... I should've raised this during that recent brief period when 
projects.h
was classified as private ;-))

> A workaround for user code would possibly be to
> #define _PROVIDER_STRUCTS_DEFINED
> before including winreg.h or anything that includes it, since the PVALUE
> stuff seems to be conditionnaly defined by that (I did not try)

This problem comes up when building the PDL::GIS::Proj (perl) module.
On Windows, it's inevitable that the building of this perl extension will
include windows.h - and hence winreg.h

I've just tried the suggestion of defining _PROVIDER_STRUCTS_DEFINED, but 
that causes other winreg.h errors:

winreg.h:181:59: error: unknown type name 'PVALENTA'
winreg.h:182:59: error: unknown type name 'PVALENTW'

Those symbols are also defined in winreg.h if _PROVIDER_STRUCTS_DEFINED is 
not already defined.

> Otherwise projects.h has always had a semi-public/semi-private status, so
> that might be OK to change that. PVALUE is only used as the return type of
> pj_param(projCtx ctx, paralist *, const char *);

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:

#ifdef __MINGW32__  */ All mingw compilers */
/* code uses PROJVALUE symbol */
#else
/* code uses PVALUE symbol */
#endif

That would significantly lessen the chances of upsetting those who have been 
using PVALUE in their own code.

I think I could provide patches for that, if it's an acceptable option.
However, I'm not sure it's such a good idea to start splitting up code like 
that.

Cheers,
Rob 




More information about the Proj mailing list