GCC build errors in nsImageWin.h and nsImageWin.cpp

RESOLVED FIXED in mozilla1.9alpha6

Status

Core Graveyard
GFX: Win32
RESOLVED FIXED
11 years ago
9 years ago

People

(Reporter: nivoside, Assigned: mats)

Tracking

(Blocks: 1 bug, {fixed1.8.0.13, fixed1.8.1.5, regression})

Trunk
mozilla1.9alpha6
x86
Windows XP
fixed1.8.0.13, fixed1.8.1.5, regression
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

11 years ago
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.
(Reporter)

Updated

11 years ago
Blocks: 203303
(Reporter)

Updated

11 years ago
Summary: MinGW build error due to Bug #329299 → Mingw build errors in nsImageWin.h and nsImageWin.cpp
I've been building succesfully (with other build problems, though) current trunk builds, using mingw, is this still an issue?
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.
Blocks: 329299
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Assignee)

Comment 3

10 years ago
(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?
Assignee: printing → win32
Component: Printing → GFX: Win32
Keywords: regression
QA Contact: ian
Summary: Mingw build errors in nsImageWin.h and nsImageWin.cpp → GCC build errors in nsImageWin.h and nsImageWin.cpp
(Assignee)

Comment 4

10 years ago
GCC fails to compile this:
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/gfx/src/windows/nsImageWin.cpp&rev=3.151&root=/cvsroot&mark=2049,2055#2047
(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

10 years ago
I guess we can put it in an #ifdef for MSVC?
(Assignee)

Updated

10 years ago
Duplicate of this bug: 382246

Comment 8

10 years ago
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?
(Assignee)

Comment 9

10 years ago
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...

Updated

10 years ago
Attachment #266471 - Flags: superreview?(benjamin)
Attachment #266471 - Flags: review+
Comment on attachment 266471 [details] [diff] [review]
Wrap it in #ifdef _MSC_VER

shiver
Attachment #266471 - Flags: superreview?(benjamin) → superreview+
(Assignee)

Updated

10 years ago
Assignee: win32 → mats.palmgren
(Assignee)

Updated

10 years ago
Duplicate of this bug: 382852
(Assignee)

Comment 12

10 years ago
Checked in to trunk at 2007-06-08 05:05 PDT.

-> FIXED
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED
(Assignee)

Updated

10 years ago
Attachment #266471 - Flags: approval1.8.1.5?
Attachment #266471 - Flags: approval1.8.0.13?
(Assignee)

Updated

10 years ago
Target Milestone: --- → mozilla1.9alpha6
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
Attachment #266471 - Flags: approval1.8.1.5?
Attachment #266471 - Flags: approval1.8.1.5+
Attachment #266471 - Flags: approval1.8.0.13?
Attachment #266471 - Flags: approval1.8.0.13+
(Assignee)

Comment 14

10 years ago
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
Keywords: fixed1.8.0.13, fixed1.8.1.5
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.