Last Comment Bug 721466 - Compiling with graphite enabled is failing with VS2010
: Compiling with graphite enabled is failing with VS2010
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Graphics (show other bugs)
: Trunk
: x86_64 Windows 7
: -- normal (vote)
: mozilla12
Assigned To: Nobody; OK to take it and work on it
:
: Milan Sreckovic [:milan]
Mentors:
Depends on: 721839
Blocks: 721068
  Show dependency treegraph
 
Reported: 2012-01-26 11:33 PST by Dave Townsend [:mossop]
Modified: 2012-01-27 12:30 PST (History)
7 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch, fix the build failure by including <stdio.h> instead of <cstdio> (734 bytes, patch)
2012-01-26 13:15 PST, Jonathan Kew (:jfkthame)
roc: review+
Details | Diff | Splinter Review

Description Dave Townsend [:mossop] 2012-01-26 11:33:01 PST
Since bug 721068 landed on inbound I get the following build failure locally:

c:/mozilla-build/python/python2.7.exe -O c:/mozilla/source/trunk/build/cl.py cl -Fojson.obj -c -D_HAS_EXCEPTIONS=0 -I../../../dist/stl_wrappers  -DMOZILLA_INTERNAL_API -D_IMPL_NS_COM -DEXPORT_XPT_API
-DEXPORT_XPTC_API -D_IMPL_NS_GFX -D_IMPL_NS_WIDGET -DIMPL_XREAPI -DIMPL_NS_NET -DIMPL_THEBES  -DOSTYPE=\"WINNT6.1\" -DOSARCH=WINNT -DPACKAGE_VERSION="\"moz\"" -DPACKAGE_BUGREPORT="\"http://bugzilla.mozilla.org/\"" -DGRAPHITE2_NFILEFACE -DGRAPHITE2_NTRACING -DGRAPHITE2_NSEGCACHE -DGRAPHITE2_STATIC -DGRAPHITE2_CUSTOM_HEADER="\"MozGrMalloc.h\""  -I../../../../../source/trunk/gfx/graphite2/src -I. -I../../../dist/include -I../../../dist/include/nsprpub  -Ic:/mozilla/build/nightly/dist/include/nspr -Ic:/mozilla/build/nightly/dist/include/nss       -TP -nologo -W3 -Gy -Fdgenerated.pdb -wd4800 -we4553 -DNDEBUG -DTRIMMED -Zi -Zi -UDEBUG -DNDEBUG -O1 -Oy -MD            -FI ../../../dist/include/mozilla-config.h -DMOZILLA_CLIENT /c/mozilla/source/trunk/gfx/graphite2/src/json.cpp
json.cpp
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iosfwd(43) : error C2061: syntax error : identifier 'fpos_t'
        c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iosfwd(117) : see reference to class template instantiation 'std::fpos<_Statetype>' being compiled
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iosfwd(58) : error C2146: syntax error : missing ';' before identifier 'seekpos'
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iosfwd(58) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iosfwd(59) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iosfwd(61) : warning C4183: 'seekpos': missing return type; assumed to be a member function returning 'int'
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iosfwd(115) : error C2146: syntax error : missing ';' before identifier '_Fpos'
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iosfwd(115) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iosfwd(115) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\iosfwd(563) : error C2065: 'EOF' : undeclared identifier
make[2]: *** [json.obj] Error 2
make[2]: Leaving directory `/c/mozilla/build/nightly/gfx/graphite2/src'
make[1]: *** [libs] Error 2
make[1]: Leaving directory `/c/mozilla/build/nightly/gfx'
make: *** [all] Error 2
make: Leaving directory `/c/mozilla/build/nightly/gfx'
Comment 1 Jonathan Kew (:jfkthame) 2012-01-26 13:15:20 PST
Created attachment 591911 [details] [diff] [review]
patch, fix the build failure by including <stdio.h> instead of <cstdio>

The attached patch, which just replaces #include <cstdio> with #include <stdio.h> in json.cpp, seems to fix the problem.

I don't really understand the underlying issue here yet - note that adding "using namespace std;" or "using std::fpos_t;" after the original #include does *not* resolve the failure.

I'd suggest we take this as a short-term fix so that people with VS2010 can continue to build without problems, while discussing the issue with upstream to try to understand it better.
Comment 2 Dave Townsend [:mossop] 2012-01-26 14:16:09 PST
This patch fixes the problem for me.
Comment 3 Jonathan Kew (:jfkthame) 2012-01-26 14:29:15 PST
Comment on attachment 591911 [details] [diff] [review]
patch, fix the build failure by including <stdio.h> instead of <cstdio>

I'm marking this r?roc, but intend to push it to inbound immediately, while review is still pending, so that people using VS2010 for local builds don't have to work around the compilation failure.
Comment 5 Matt Brubeck (:mbrubeck) 2012-01-27 09:11:18 PST
https://hg.mozilla.org/mozilla-central/rev/a02b6f797e02

Note You need to log in before you can comment on or make changes to this bug.