failure to compile gfx/src/gtk/nsFT2FontCatalog.cpp

RESOLVED FIXED in mozilla0.9.9

Status

SeaMonkey
General
RESOLVED FIXED
17 years ago
14 years ago

People

(Reporter: lhecking, Assigned: kill this account)

Tracking

Trunk
mozilla0.9.9
Sun
Solaris

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

17 years ago
I haven't been able to compile mozilla-cvs for a few days:

gmake[4]: Entering directory `/export/home/lhecking/mozilla/gfx/src/gtk'
nsFT2FontCatalog.cpp
c++ -o nsFT2FontCatalog.o -c -DOSTYPE=\"SunOS5\" -DOSARCH=\"SunOS\" -DOJI
-D_IMPL_NS_GFXNONXP -DUSE_POSTSCRIPT -DUSE_XPRINT -DUSE_MOZILLA_TYPES
-DMOZ_ENABLE_FREETYPE2 -I./. -I./.. -I./../x11shared 
-I../../../dist/include/xpcom -I../../../dist/include/string
-I../../../dist/include/widget -I../../../dist/include/view
-I../../../dist/include/util -I../../../dist/include/dom
-I../../../dist/include/pref -I../../../dist/include/uconv
-I../../../dist/include/unicharutil -I../../../dist/include/windowwatcher
-I../../../dist/include/locale -I../../../dist/include/content
-I../../../dist/include/layout -I../../../dist/include/necko
-I../../../dist/include/gfx -I../../../dist/include
-I/export/home/lhecking/mozilla/dist/include/nspr     
-I/usr/local/include/freetype2 -I/usr/openwin/include   -fPIC 
-I/usr/openwin/include -fno-rtti -fno-exceptions -pedantic -Wno-long-long
-pthreads  -DNDEBUG -DTRIMMED -O3 -mcpu=v8 -mtune=v9 -pipe
-I/usr/local/gtk/include/gtk-1.2 -I/usr/local/gtk/lib/glib/include
-I/usr/local/gtk/include -I/usr/openwin/include   -I/usr/openwin/include
-DMOZILLA_CLIENT -include ../../../config-defs.h
-Wp,-MD,.deps/nsFT2FontCatalog.pp nsFT2FontCatalog.cpp
In file included from /usr/local/gtk/include/gtk-1.2/gdk/gdktypes.h:33,
                 from /usr/local/gtk/include/gtk-1.2/gdk/gdk.h:31,
                 from /usr/local/gtk/include/gtk-1.2/gtk/gtk.h:31,
                 from nsDrawingSurfaceGTK.h:46,
                 from nsRenderingContextGTK.h:56,
                 from nsDeviceContextGTK.h:48,
                 from nsFontMetricsGTK.h:42,
                 from nsFT2FontCatalog.cpp:52:
/usr/local/gtk/include/glib.h:1310: warning: ANSI C does not allow macro with
variable arguments
/usr/local/gtk/include/glib.h:1313: warning: ANSI C does not allow macro with
variable arguments
/usr/local/gtk/include/glib.h:1316: warning: ANSI C does not allow macro with
variable arguments
/usr/local/gtk/include/glib.h:1319: warning: ANSI C does not allow macro with
variable arguments
nsFT2FontCatalog.cpp: In method `PRBool
nsFT2FontCatalog::GetFontSummaryName(const nsAReadableCString &, const
nsAReadableCString &, nsAWritableCString &, nsAWritableCString &)':
nsFT2FontCatalog.cpp:823: `major' undeclared (first use this function)
nsFT2FontCatalog.cpp:823: (Each undeclared identifier is reported only once
nsFT2FontCatalog.cpp:823: for each function it appears in.)
nsFT2FontCatalog.cpp:823: `minor' undeclared (first use this function)
gmake[4]: *** [nsFT2FontCatalog.o] Error 1

 gtk+/glib 1.2.10
font catalog code --> bstell
Assignee: asa → bstell
(Assignee)

Comment 2

17 years ago
Brendan: I used what I thought were the macros to get the major/minor numbers
from stat. Should I have used:

http://lxr.mozilla.org/seamonkey/source/gfx/src/x11shared/nsFT2FontCatalog.cpp#8
23
823     sprintf(buf, ".d%d-%d.i%d", major(dev), minor(dev), inode);

If not could you give me a pointer to the correct item to use?
Or are these macros not available on Solaris?
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Target Milestone: --- → mozilla0.9.9
(Reporter)

Comment 3

17 years ago
On Solaris 7 and 8, these macros are defined in <sys/sysmacros.h>. Probably
needs to be included directly.

$ grep sys/sysmacros.h *.h
$ grep sys/sysmacros.h */*.h
nfs/nfs.h:#include <sys/sysmacros.h>
sys/cpr.h:#include <sys/sysmacros.h>
sys/pccard.h:#include <sys/sysmacros.h>
sys/vmmac.h:#include <sys/sysmacros.h>
$ 

Yep, when I add the corresponding include statement, it compiles. As I am not
familiar with the mozilla code, I can't say whether this is the corredct solution :)
(Assignee)

Comment 4

17 years ago
Katakai: did you build this solaris? 
If so, did you have to do some to make it build?

I'd be glad to work on this if I had a clue what is the correct way to
fix this.

Comment 5

17 years ago
I have tested this on Solaris 8, and Solaris 9 with Forte 7 and both compile
fine. Adding myself to cc: we need to find out what compiler this guy is using
before we jump to changing any code. It looks as though it may be an older
version of Workshop maybe. Anyway WORKSFORME ;)

-dcran
(Assignee)

Comment 6

17 years ago
lhecking: 

What version of solaris are you running?

What compilier are you running?

Comment 7

17 years ago
according to the man pages for major/minor, you need to include:

#include <sys/types.h>
#include <sys/mkdev.h>

this makes it compile for me on Solaris 8 with Sun Forte 6U2
(Assignee)

Comment 8

17 years ago
humm, sys/mkdev.h does not seem to exist on my Redhat 6.2 system
(Assignee)

Comment 9

17 years ago
anyone have suggestions?

we could do:

  #ifndef major
  #include <sys/types.h>
  #include <sys/mkdev.h>
  #endif

or

  #ifdef SOLARIS
  ...

Without a plan I'm unsure how we will get this in before 0.9.9 branches.
cls, shaver: my Unix fu is too old and gray -- can you guys help?

/be
Also, bstell: do we *really* need to crack major and minor from device number in
this code?

/be
(Assignee)

Comment 12

17 years ago
Created attachment 71109 [details] [diff] [review]
discontinue using major/minor macros

great idea!
thanks for suggesting that
Comment on attachment 71109 [details] [diff] [review]
discontinue using major/minor macros

This looks fine, if device numbers usually fit in 16 bits still (I thought most
Unixes went to 32 bits a while ago, in which case you might prefer %08x for the
format).

sr=brendan@mozilla.org, get this into 0.9.9 ASAP I say.

/be
Attachment #71109 - Flags: superreview+
(Assignee)

Updated

17 years ago
Summary: failure to compile gfx/src/gtk/nsFT2FontCatalog.cpp → (waiting for a=) failure to compile gfx/src/gtk/nsFT2FontCatalog.cpp
Whiteboard: waiting for a=
Did you remove any now-unneeded #includes?

Go ahead and check in -- this is a build bustage fix.

/be
Keywords: mozilla0.9.9+
(Assignee)

Comment 15

17 years ago
I compared the include in the attachments before I used the macros with the
current code and did not see any additional includes.
(Assignee)

Comment 16

17 years ago
checked in
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED
(Assignee)

Updated

17 years ago
Summary: (waiting for a=) failure to compile gfx/src/gtk/nsFT2FontCatalog.cpp → failure to compile gfx/src/gtk/nsFT2FontCatalog.cpp
Whiteboard: waiting for a=
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.