Last Comment Bug 363592 - GCC build errors in nsImageWin.h and nsImageWin.cpp
: GCC build errors in nsImageWin.h and nsImageWin.cpp
Status: RESOLVED FIXED
: fixed1.8.0.13, fixed1.8.1.5, regression
Product: Core Graveyard
Classification: Graveyard
Component: GFX: Win32 (show other bugs)
: Trunk
: x86 Windows XP
: -- normal (vote)
: mozilla1.9alpha6
Assigned To: Mats Palmgren (:mats)
: Hixie (not reading bugmail)
Mentors:
: 382246 382852 (view as bug list)
Depends on:
Blocks: mingw 329299
  Show dependency treegraph
 
Reported: 2006-12-12 08:01 PST by nivoside
Modified: 2009-01-22 10:17 PST (History)
7 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Wrap it in #ifdef _MSC_VER (1.99 KB, patch)
2007-05-29 06:37 PDT, Mats Palmgren (:mats)
mozilla: review+
benjamin: superreview+
dveditz: approval1.8.1.5+
dveditz: approval1.8.0.13+
Details | Diff | Splinter Review

Description nivoside 2006-12-12 08:01:12 PST
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; ja; rv:1.8.0.8) Gecko/20061105 Firefox/1.5.0.8
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; ja; rv:1.8.0.8) Gecko/20061105 Firefox/1.5.0.8

The patch of Bug 329299 seems to build with MinGW fail.


The same problem also on MOZILLA_1_8_BRANCH is caused though it is a record when failing in MOZILLA_1_8_0_BRANCH.

m:/mozilla/gfx/src/windows/nsImageWin.h: In constructor `nsImageWin::nsImageWin()':
m:/mozilla/gfx/src/windows/nsImageWin.h:289: warning: `nsImageWin::mHBitmap' will be initialized after
m:/mozilla/gfx/src/windows/nsImageWin.h:285: warning:   `PRUint8*nsImageWin::mAlphaBits'
m:/mozilla/gfx/src/windows/nsImageWin.cpp:98: warning:   when initialized here
m:/mozilla/gfx/src/windows/nsImageWin.h:285: warning: `nsImageWin::mAlphaBits' will be initialized after
m:/mozilla/gfx/src/windows/nsImageWin.h:277: warning:   `nsColorMap*nsImageWin::mColorMap'
m:/mozilla/gfx/src/windows/nsImageWin.cpp:98: warning:   when initialized here
m:/mozilla/gfx/src/windows/nsImageWin.h:290: warning: `nsImageWin::mBHead' will be initialized after
m:/mozilla/gfx/src/windows/nsImageWin.h:270: warning:   `PRPackedBool nsImageWin::mDIBTemp'
m:/mozilla/gfx/src/windows/nsImageWin.cpp:98: warning:   when initialized here
m:/mozilla/gfx/src/windows/nsImageWin.h:275: warning: `nsImageWin::mRowBytes' will be initialized after
m:/mozilla/gfx/src/windows/nsImageWin.h:268: warning:   `PRPackedBool nsImageWin::mIsOptimized'
m:/mozilla/gfx/src/windows/nsImageWin.cpp:98: warning:   when initialized here
m:/mozilla/gfx/src/windows/nsImageWin.h:282: warning: `nsImageWin::mDecodedY2' will be initialized after
m:/mozilla/gfx/src/windows/nsImageWin.h:269: warning:   `PRPackedBool nsImageWin::mIsLocked'
m:/mozilla/gfx/src/windows/nsImageWin.cpp:98: warning:   when initialized here
m:/mozilla/gfx/src/windows/nsImageWin.h:288: warning: `nsImageWin::mImageCache' will be initialized after
m:/mozilla/gfx/src/windows/nsImageWin.h:266: warning:   `PRPackedBool nsImageWin::mInitialized'
m:/mozilla/gfx/src/windows/nsImageWin.cpp:98: warning:   when initialized here
m:/mozilla/gfx/src/windows/nsImageWin.h:294: warning: `nsImageWin::mTimer' will be initialized after
m:/mozilla/gfx/src/windows/nsImageWin.h:271: warning:   `PRPackedBool nsImageWin::mImagePreMultiplied'
m:/mozilla/gfx/src/windows/nsImageWin.cpp:98: warning:   when initialized here
m:/mozilla/gfx/src/windows/nsImageWin.cpp: In member function `virtual nsresult nsImageWin::DrawTile(nsIRender
ingContext&, nsIDrawingSurface*, PRInt32, PRInt32, PRInt32, PRInt32, const nsRect&)':
m:/mozilla/gfx/src/windows/nsImageWin.cpp:979: warning: converting to `PRInt32' from `float'
m:/mozilla/gfx/src/windows/nsImageWin.cpp:980: warning: converting to `PRInt32' from `float'
m:/mozilla/gfx/src/windows/nsImageWin.cpp: In function `void CompositeBitsInMemory(HDC__*, int, int, int, int,
 int, int, int, int, PRInt32, PRUint8*, MONOBITMAPINFO*, PRUint8*, tagBITMAPINFOHEADER*, PRInt16)':
m:/mozilla/gfx/src/windows/nsImageWin.cpp:2044: error: `__try' undeclared (first use this function)
m:/mozilla/gfx/src/windows/nsImageWin.cpp:2044: error: (Each undeclared identifier is reported only once for e
ach function it appears in.)
m:/mozilla/gfx/src/windows/nsImageWin.cpp:2044: error: expected `;' before '{' token
m:/mozilla/gfx/src/windows/nsImageWin.cpp:2050: error: `__except' undeclared (first use this function)
m:/mozilla/gfx/src/windows/nsImageWin.cpp:2050: error: expected `;' before '{' token
make[5]: *** [nsImageWin.o] Error 1
make[5]: Leaving directory `/cygdrive/m/mozilla/obj-i686-pc-cygwin/gfx/src/windows'
make[4]: *** [libs] Error 2
make[4]: Leaving directory `/cygdrive/m/mozilla/obj-i686-pc-cygwin/gfx/src'
make[3]: *** [libs] Error 2
make[3]: Leaving directory `/cygdrive/m/mozilla/obj-i686-pc-cygwin/gfx'
make[2]: *** [tier_9] Error 2
make[2]: Leaving directory `/cygdrive/m/mozilla/obj-i686-pc-cygwin'
make[1]: *** [alldep] Error 2
make[1]: Leaving directory `/cygdrive/m/mozilla/obj-i686-pc-cygwin'
make: *** [alldep] Error 2

The comment that remains in Bonsai is wrong. I believe that the patch of Bug 329299 is a cause in this.

Reproducible: Always

Steps to Reproduce:
1.The source is downloaded.
2.Build is started.
3.The error is reported.

Actual Results:  
Build fails.

Expected Results:  
It enjoys Firefox of the latest version in the family.

When trying by the following versions, the published error log is the one.

binutils        20050610-1
gcc             3.3.3-3
gcc-core        3.3.3-3
gcc-g++         3.3.3-3
gcc-mingw-core  20040810-1
gcc-mingw-g++   20040810-1
make            3.80-1
mingw-runtime   3.10-1
w32api          3.7-1

Even if "Current" that mingw.org distributes is used, it is confirmed to fail.
Comment 1 Martijn Wargers [:mwargers] (not working for Mozilla) 2007-02-22 02:12:17 PST
I've been building succesfully (with other build problems, though) current trunk builds, using mingw, is this still an issue?
Comment 2 Martijn Wargers [:mwargers] (not working for Mozilla) 2007-02-26 01:41:09 PST
Hmm, yeah, I'm seeing it now too, only with a 1.8.1 branch build, not with trunk.
Not sure why the difference between trunk and branch.
Comment 3 Mats Palmgren (:mats) 2007-04-12 23:01:09 PDT
(In reply to comment #2)
> Not sure why the difference between trunk and branch.

You build gfx/src/thebes on trunk and not gfx/src/windows?
Comment 5 Martijn Wargers [:mwargers] (not working for Mozilla) 2007-04-12 23:14:51 PDT
(In reply to comment #3)
> > Not sure why the difference between trunk and branch.
> You build gfx/src/thebes on trunk and not gfx/src/windows?

Ah, heh, yeah, that's the reason.
Comment 6 Mike Kaply [:mkaply] 2007-04-13 08:21:44 PDT
I guess we can put it in an #ifdef for MSVC?
Comment 7 Mats Palmgren (:mats) 2007-05-28 20:40:29 PDT
*** Bug 382246 has been marked as a duplicate of this bug. ***
Comment 8 Mike Kaply [:mkaply] 2007-05-29 06:11:09 PDT
A similar bug in another project (http://bugs.miranda-im.org/view.php?id=1553) was resolved with:

  #define __try
    #define __except(x) if (0) /* don't execute handler */
    #define __finally
    #define _try __try
    #define _except __except
    #define _finally __finally

In some central location.

Where should we do this for GCC and with what #ifdef?
Comment 9 Mats Palmgren (:mats) 2007-05-29 06:37:08 PDT
Created attachment 266471 [details] [diff] [review]
Wrap it in #ifdef _MSC_VER

Nice trick, but it makes the code obscure IMO.  Unless you know about
these #defines beforehand there is no way of knowing that the code
will do different things depending on which compiler you use.
Since this is the only place so far I would just #ifdef it in-place.
Just my 2 cents...
Comment 10 Benjamin Smedberg [:bsmedberg] 2007-05-29 19:29:28 PDT
Comment on attachment 266471 [details] [diff] [review]
Wrap it in #ifdef _MSC_VER

shiver
Comment 11 Mats Palmgren (:mats) 2007-06-01 19:38:11 PDT
*** Bug 382852 has been marked as a duplicate of this bug. ***
Comment 12 Mats Palmgren (:mats) 2007-06-08 05:07:01 PDT
Checked in to trunk at 2007-06-08 05:05 PDT.

-> FIXED
Comment 13 Daniel Veditz [:dveditz] 2007-06-26 15:57:14 PDT
Comment on attachment 266471 [details] [diff] [review]
Wrap it in #ifdef _MSC_VER

approved for 1.8.1.5 and 1.8.0.13, a=dveditz for release-drivers
Comment 14 Mats Palmgren (:mats) 2007-07-01 09:34:51 PDT
Checked in to MOZILLA_1_8_BRANCH:
/cvsroot/mozilla/gfx/src/windows/nsImageWin.cpp,v: 3.149.6.3

Checked in to MOZILLA_1_8_0_BRANCH:
/cvsroot/mozilla/gfx/src/windows/nsImageWin.cpp,v: 3.149.14.2

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