Opened 12 years ago

Closed 12 years ago

#2218 closed defect (fixed)

json broken on windows

Reported by: robe Owned by: robe
Priority: blocker Milestone: PostGIS 2.1.0
Component: postgis Version: master
Keywords: Cc:

Description

I'm putting this in just so I remember, but winnie has been coughing up blood

In file included from c:/ming64/projects/json-c/rel-0.9w64/include/json/json_util.h:15:0,
                 from c:/ming64/projects/json-c/rel-0.9w64/include/json/json.h:23,
                 from lwin_geojson.c:20:
c:/ming64/projects/json-c/rel-0.9w64/include/json/json_object.h:233:60: error: expected ')' before 'b'
c:/ming64/projects/json-c/rel-0.9w64/include/json/json_object.h:246:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'json_object_get_boolean'
In file included from lwin_geojson.c:21:0:
c:/ming64/projects/json-c/rel-0.9w64/include/json/json_object_private.h:31:5: error: expected specifier-qualifier-list before 'boolean'
make[1]: *** [lwin_geojson.lo] Error 1
make[1]: Leaving directory `/c/jenkins/postgis/branches/2.1/liblwgeom'
make: *** [all] Error 1

since strk's recent migration of json support to liblwgeom.

at r11119

I suspect its the same issue as when we tried to migrate some other stuff before. something to do with order of includes or double includes, conflicting includes that may only be an issue on windows.

I'll test on my local box when I get back to verify if its just a simple misconfiguration on winnie or something that needs to be fixed in code base.

Change History (8)

comment:1 by robe, 12 years ago

Owner: changed from pramsey to strk

Only if you want to strk — can you look and see if you can swap the includes or something to make winnie happy again :). If its not obvious what to do, guess it will have to wait till I get back to do more investigative work.

comment:2 by strk, 12 years ago

Line 233 of json_object.h uses a type name "boolean" which isn't defined anywhere, and that file doesn't include any other.

Maybe it used to work before because postgresql or other part of our dependencies included an heade with definition of "boolean".

I'll have to further inspect if json includes themselves use "boolean" and in which header.

comment:3 by strk, 12 years ago

Oops, I was wrong, "boolean" is defined within the same header! line 32: typedef int boolean;

So maybe it's the other way around: something is defining "boolean" _before_ including that header ?

comment:4 by strk, 12 years ago

Robe: I suggest you try swapping headers in liblwgeom/lwin_geojson.c and see if that helps

comment:5 by robe, 12 years ago

strk: sorry really bogged down this weekend so won't have time to do this. If you do, winnie will complain or not.

Anyrate I can tell you that json does include a boolean and I have had to remark it out and unremark it to have it work on windows.

Here are relevant notes from - http://trac.osgeo.org/postgis/wiki/DevWikiWinMingW64

about this issue.

{{{ Open up /c/projects/json-c/rel-0.9/include/json/json_object.h

remark out line 32 that reads

typedef int boolean

so it should now read

/ typedef int boolean; /

During the PostGIS configure process, you have to put this back the way it was otherwise configure complains json.h or something is not usable and refuses to configure with JSON-C support. Then you remark the line out again during compile. Crazy I know, but json-c won't compile without that line so can't take it out before json-c compile.

}}}

comment:6 by robe, 12 years ago

Owner: changed from strk to robe

strk, You are grundgingly off the hook on this one. I guess I'll have to find something else to be mad about you about.

It seems if I take out my json hack then it compiles cleanly. So now I have just the annoying problem that I have to change my script for 2.1.0 to not put in the hack and for 2.0 to continue with the hack — unless of course you think its safe to make same fix to 2.0 branch and save me the hassle of make a conditional statement for 2.0.

I'll close this out once I've Winnie is happy again.

comment:7 by robe, 12 years ago

Slight correction — I still have to use my hack — remarking out the int boolean to get configure to work, but I don't have to apply the second hack of doing a switcharoo to put it back.

comment:8 by robe, 12 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.