Closed Bug 126979 Opened 23 years ago Closed 23 years ago

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

Categories

(SeaMonkey :: General, defect)

Sun
Solaris
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla0.9.9

People

(Reporter: lhecking, Assigned: bstell)

Details

Attachments

(1 file)

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
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
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 :)
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.
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
lhecking: 

What version of solaris are you running?

What compilier are you running?
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
humm, sys/mkdev.h does not seem to exist on my Redhat 6.2 system
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
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+
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+
I compared the include in the attachments before I used the macros with the
current code and did not see any additional includes.
checked in
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
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.

Attachment

General

Created:
Updated:
Size: