[Proj] [MS Windows] PVALUE causes problems with mingw64 compilers

Even Rouault even.rouault at spatialys.com
Tue May 19 13:03:48 EST 2015


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:
> > 
> > Hi,
> > 
> > The problem arises when the mingw64 header winreg.h gets included.
> > We then get errors like:
> > 
> > C:/tmp64ng/c/include/projects.h:161:47: error: conflicting types for
> > 'PVALUE'
> > 
> >  typedef union { double  f; int  i; char *s; } PVALUE;
> > 
> > ....
> > C:/tmp64ng/c/x86_64-w64-mingw32/include/winreg.h:75:3: note: previous
> > declaration of 'PVALUE' was here
> > 
> >    __MINGW_TYPEDEF_AW(PVALUE)
> >    ^
> > 
> > The fairly simple (though tedious) workaround is, prior to building proj,
> > change each of the few occurrences of "PVALUE" in the proj source to a
> > symbol that doesn't clash.
> > (I've been using "_P_VALUE", but perhaps something like "PROJVALUE" is a
> > better choice .... I'm happy with *any* symbol that's not going to
> > clash.)
> > 
> > Could the proj developers please rename "PVALUE" to something that
> > doesn't clash ?
> > I really would like to not have to alter the proj source in future proj
> > releases.
> > 
> > I did raise this matter a few years ago but, as nothing was ever done, I
> > thought that maybe I should instead submit a bug report along with a
> > patch. However, AFAICT, to submit a bug report I need to go to
> > http://www.osgeo.org/osgeo_userid/ and create a user id so that I can
> > first log in.
> > 
> > Unfortunately the link to "this simple form" (
> > https://www.osgeo.org/cgi-bin/ldap_create_user.py ) results in a "page
> > can't be displayed error" for me.
> > There's a suggestion there that this could be a problem with my browser
> > settings, though I don't usually have any trouble with secure
> > connections.
> > 
> > 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.
> 
> 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. Does anyone else have an opinion?

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)

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 *);

> 
> Howard
> _______________________________________________
> Proj mailing list
> Proj at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/proj

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the Proj mailing list