Last Comment Bug 375506 - Fix for bug 372629 breaks Mingw - build error in gfxWindowsFonts.cpp
: Fix for bug 372629 breaks Mingw - build error in gfxWindowsFonts.cpp
Status: RESOLVED FIXED
: regression
Product: Core
Classification: Components
Component: Graphics (show other bugs)
: Trunk
: x86 Windows XP
: -- normal (vote)
: ---
Assigned To: Martijn Wargers [:mwargers] (not working for Mozilla)
:
: Milan Sreckovic [:milan]
Mentors:
Depends on:
Blocks: mingw 372629
  Show dependency treegraph
 
Reported: 2007-03-27 00:29 PDT by Bengt-Erik Soderstrom
Modified: 2007-07-30 18:59 PDT (History)
7 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (2.57 KB, patch)
2007-04-02 07:54 PDT, Martijn Wargers [:mwargers] (not working for Mozilla)
roc: review+
Details | Diff | Splinter Review
mingw patch (1.13 KB, patch)
2007-04-02 08:02 PDT, Martijn Wargers [:mwargers] (not working for Mozilla)
no flags Details | Diff | Splinter Review
mingw patch (2.32 KB, patch)
2007-04-03 03:39 PDT, Martijn Wargers [:mwargers] (not working for Mozilla)
no flags Details | Diff | Splinter Review

Description Bengt-Erik Soderstrom 2007-03-27 00:29:16 PDT
I think the fix for bug 372629 broke Mingw builds:
d:/mozilla/mozilla/gfx/thebes/src/gfxWindowsFonts.cpp: In member function `HFONT

__* gfxWindowsFont::MakeHFONT()':
d:/mozilla/mozilla/gfx/thebes/src/gfxWindowsFonts.cpp:232: warning: comparison b
etween signed and unsigned integer expressions
d:/mozilla/mozilla/gfx/thebes/src/gfxWindowsFonts.cpp: In function `PRBool Setup
TextRunFromGlyphs(gfxTextRun*, WCHAR*, HDC__*, gfxWindowsFont*)':
d:/mozilla/mozilla/gfx/thebes/src/gfxWindowsFonts.cpp:662: error: `GetTextExtent
ExPointI' was not declared in this scope
d:/mozilla/mozilla/gfx/thebes/src/gfxWindowsFonts.cpp:662: warning: unused varia
ble 'GetTextExtentExPointI'
d:/mozilla/mozilla/gfx/thebes/src/gfxWindowsFonts.cpp: In member function `void
gfxWindowsFontGroup::InitTextRunGDI(gfxContext*, gfxTextRun*, const char*, PRUin
t32)':
d:/mozilla/mozilla/gfx/thebes/src/gfxWindowsFonts.cpp:706: error: invalid conver
sion from `WCHAR*' to `WORD*'
d:/mozilla/mozilla/gfx/thebes/src/gfxWindowsFonts.cpp: In member function `void
gfxWindowsFontGroup::InitTextRunGDI(gfxContext*, gfxTextRun*, const PRUnichar*,
PRUint32)':
d:/mozilla/mozilla/gfx/thebes/src/gfxWindowsFonts.cpp:730: error: invalid conver
sion from `WCHAR*' to `WORD*'
d:/mozilla/mozilla/gfx/thebes/src/gfxWindowsFonts.cpp: In constructor `Uniscribe
Item::UniscribeItem(gfxContext*, HDC__*, const PRUnichar*, PRUint32, SCRIPT_ITEM
*, gfxWindowsFontGroup*)':
d:/mozilla/mozilla/gfx/thebes/src/gfxWindowsFonts.cpp:1426: warning: `UniscribeI
tem::mAlternativeString' will be initialized after
d:/mozilla/mozilla/gfx/thebes/src/gfxWindowsFonts.cpp:1420: warning:   `SCRIPT_I
TEM*UniscribeItem::mScriptItem'
d:/mozilla/mozilla/gfx/thebes/src/gfxWindowsFonts.cpp:894: warning:   when initi
alized here
d:/mozilla/mozilla/gfx/thebes/src/gfxWindowsFonts.cpp:1435: warning: `UniscribeI
tem::mNumGlyphs' will be initialized after
d:/mozilla/mozilla/gfx/thebes/src/gfxWindowsFonts.cpp:1434: warning:   `int Unis
cribeItem::mMaxGlyphs'
d:/mozilla/mozilla/gfx/thebes/src/gfxWindowsFonts.cpp:894: warning:   when initi
alized here
d:/mozilla/mozilla/gfx/thebes/src/gfxWindowsFonts.cpp: In member function `void
gfxWindowsFontGroup::InitTextRunUniscribe(gfxContext*, gfxTextRun*, const PRUnic
har*, PRUint32)':
d:/mozilla/mozilla/gfx/thebes/src/gfxWindowsFonts.cpp:1538: warning: unused vari
able 'fontIndex'
../../../dist/include/thebes/gfxWindowsFonts.h: At global scope:
../../../dist/include/thebes/gfxWindowsFonts.h:232: warning: 'PRUint8 CharRangeB
it(PRUint32)' defined but not used
make[6]: *** [gfxWindowsFonts.o] Error 1
make[6]: Leaving directory `/cygdrive/d/mozilla/mozilla/object-mingw/gfx/thebes/
src'
make[5]: *** [libs] Error 2
make[5]: Leaving directory `/cygdrive/d/mozilla/mozilla/object-mingw/gfx/thebes'
make[4]: *** [libs] Error 2
make[4]: Leaving directory `/cygdrive/d/mozilla/mozilla/object-mingw/gfx'
make[3]: *** [libs_tier_gecko] Error 2
make[3]: Leaving directory `/cygdrive/d/mozilla/mozilla/object-mingw'
make[2]: *** [tier_gecko] Error 2
make[2]: Leaving directory `/cygdrive/d/mozilla/mozilla/object-mingw'
make[1]: *** [alldep] Error 2
make[1]: Leaving directory `/cygdrive/d/mozilla/mozilla/object-mingw'
make: *** [alldep] Error 2
Comment 1 Robert O'Callahan (:roc) (email my personal email if necessary) 2007-03-27 21:29:29 PDT
I don't have mingw installed, can someone give me a patch? It shouldn't be hard except I'm not sure why GetTextExtentExPointI is undefined.
Comment 2 Martijn Wargers [:mwargers] (not working for Mozilla) 2007-04-02 07:54:18 PDT
Created attachment 260344 [details] [diff] [review]
patch

Sorry for the delay, this is a fix similar to the one in bug 373010.
This doesn't fix the 'GetTextExtentExPointI' issue. It seems to me that part should be fixed in wingdi.h.
Comment 3 Martijn Wargers [:mwargers] (not working for Mozilla) 2007-04-02 08:02:08 PDT
Created attachment 260346 [details] [diff] [review]
mingw patch

Like this, the wingdi.h file resides (for me) in c:\mozilla\mingw\include\
Hans-Andreas, is this a correct patch? Or should this be somewhere fixed in Mozilla's repository? I have no idea where/how to submit patches to mingw.

This patch, combined with the previous patch makes thebes compile again.
Comment 4 Hans-Andreas Engel 2007-04-02 08:17:47 PDT
Indeed wingdi.h is not part of the mozilla repository, http://lxr.mozilla.org/seamonkey/find?string=wingdi.h

You can submit patches to MinGW/w32api to its sourceforge page.  As an example you might take a look at one of the patches I have submitted there.
http://sourceforge.net/tracker/index.php?func=detail&aid=1456159&group_id=2435&atid=302435
Submitting went very smooth and Danny Smith's responses were timely.

As soon as a w32api version containing your patch comes out, it would be useful if you post the version number here.

There is no unique location wingdi.h, it depends how you have configured your build environment.  It is just important that one only has it in ONE location, to be sure that one patches the right file :)

Thank you for keeping the MinGW build alive!
Comment 5 Martijn Wargers [:mwargers] (not working for Mozilla) 2007-04-02 17:22:23 PDT
Thanks for the info.
It's pure self interest to keep the mingw build alive.

Apparently, something is missing in my patches, I get this build error (a linker error?):

rm -f thebes.dll
/cygdrive/c/mozilla/mozilla/build/cygwin-wrapper g++ -mno-cygwin -shared -Wl,--o
ut-implib -Wl,libthebes.dll.a -o thebes.dll  gfxASurface.o gfxAlphaRecovery.o gf
xContext.o gfxImageSurface.o gfxFont.o gfxFontTest.o gfxMatrix.o gfxFontMissingG
lyphs.o gfxPattern.o gfxPlatform.o gfxRect.o gfxSkipChars.o gfxTextRunCache.o gf
xWindowsFonts.o gfxWindowsPlatform.o gfxWindowsSurface.o gfxWindowsNativeDrawing
.o nsUnicodeRange.o gfxPDFSurface.o   ./module.res          -Wl,--whole-archive
../../../gfx/cairo/cairo/src/libmozcairo.a ../../../gfx/cairo/libpixman/src/libm
ozlibpixman.a  -Wl,--no-whole-archive ../../../dist/lib/libunicharutil_s.a -L../
../../dist/lib -lxpcom -lxpcom_core -L../../../dist/lib -lnspr4 -lplc4 -lplds4 -
L../../../modules/zlib/src -lmozz   -lm  -lgdi32 -lwinmm -lwsock32 -lusp10 -luui
d -lgdi32
Creating library file: libthebes.dll.a
gfxWindowsFonts.o: In function `Z22SetupTextRunFromGlyphsP10gfxTextRunPwP5HDC(gf
xWindowsFont *)':c:/mozilla/mozilla/gfx/thebes/src/gfxWindowsFonts.cpp:662: unde
fined reference to `GetTextExtentExPointI@28'
collect2: ld returned 1 exit status
make[3]: *** [thebes.dll] Error 1
make[3]: Leaving directory `/cygdrive/c/mozilla/mozilla/gfx/thebes/src'
make[2]: *** [libs] Error 2
make[2]: Leaving directory `/cygdrive/c/mozilla/mozilla/gfx/thebes'
make[1]: *** [libs] Error 2
make[1]: Leaving directory `/cygdrive/c/mozilla/mozilla/gfx'
make: *** [all] Error 2

C:\mozilla\mozilla\gfx>
Comment 6 Hans-Andreas Engel 2007-04-02 18:34:05 PDT
Probably you have to update the .def file as well, see e.g. my patch/file   	 usp10.h at http://sourceforge.net/tracker/index.php?func=detail&aid=1456654&group_id=2435&atid=302435

Then you have to rebuild (make) the w32api.

I do not remember the details, but with these hints you should be able to fix your problem quickly.
Comment 7 Martijn Wargers [:mwargers] (not working for Mozilla) 2007-04-03 03:39:58 PDT
Created attachment 260442 [details] [diff] [review]
mingw patch

Thanks! This makes it work.
For people who want to know how to download and build the w32api from source, see the instructions from Hans-Andreas in bug 328499, comment 48.
Comment 8 Martijn Wargers [:mwargers] (not working for Mozilla) 2007-04-03 03:54:45 PDT
Indeed, submitting to the sourceforge page went very smooth:
http://sourceforge.net/tracker/index.php?func=detail&aid=1693515&group_id=2435&atid=302435
Comment 9 Bengt-Erik Soderstrom 2007-04-03 12:02:42 PDT
I have now tested your patch for Mingw and for gfxWindowsFonts.cpp. It works fine!
Maybe we can ask Pavlov who has lately made changes to gfxWindowsFonts.cpp to review and after OK check-in. (I have put him on the cc list.)
Hopefully the Mingw will be checked in soon.
Thanks again, Martijn. 
Comment 10 Martijn Wargers [:mwargers] (not working for Mozilla) 2007-04-04 11:43:03 PDT
Checking in gfxWindowsFonts.cpp;
/cvsroot/mozilla/gfx/thebes/src/gfxWindowsFonts.cpp,v  <--  gfxWindowsFonts.cpp
new revision: 1.106; previous revision: 1.105
done

Checked into trunk.
Comment 11 Martijn Wargers [:mwargers] (not working for Mozilla) 2007-07-26 10:07:00 PDT
I haven't heard back from ming sourceforge yet. (see comment 8). Not idea what's going on there.
Comment 12 Hans-Andreas Engel 2007-07-26 10:52:21 PDT
Martijn, you might try to ask Danny Smith [dannysmith () clear.net.nz] to commit your patches.  He was very friendly and helpful with my patches about a year ago.
Comment 13 Martijn Wargers [:mwargers] (not working for Mozilla) 2007-07-30 18:59:32 PDT
Ok, thanks. Indeed that helped. He responded almost immediately and it's now checked into the mingw repository.

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