Closed Bug 484457 Opened 15 years ago Closed 15 years ago

Define Status int breaks OSX builds when including MachineExceptions.h

Categories

(Core :: Graphics, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.2a1

People

(Reporter: jeremyhu, Assigned: jeremyhu)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1b3) Gecko/20090305 Firefox/3.1b3
Build Identifier: 3.1b3 1.9.1


/usr/bin/g++-4.0 -o gfxPlatformGtk.o -c -I../../../dist/include/system_wrappers -include ../../../config/gcc_hidden.h -DIMPL_THEBES -DMOZILLA_INTERNAL_API -D_IMPL_NS_COM -DEXPORT_XPT_API -DEXPORT_XPTC_API -D_IMPL_NS_COM_OBSOLETE -D_IMPL_NS_GFX -D_IMPL_NS_WIDGET -DIMPL_XREAPI -DIMPL_NS_NET -DIMPL_THEBES  -DOSTYPE=\"Darwin9.6.0\" -DOSARCH=Darwin  -I. -I. -I../../../dist/include/cairo -I../../../dist/include/string -I../../../dist/include/pref -I../../../dist/include/xpcom -I../../../dist/include/unicharutil -I../../../dist/include/lcms -I../../../dist/include/locale -I../../../dist/include   -I../../../dist/include/thebes -I/opt/local/include/nspr -I/opt/local/include  -I/opt/local/include  -I/opt/local/var/macports/build/_Users_jeremy_src_macports-trunk_dports_www_firefox-x11/work/mozilla-1.9.1/dist/sdk/include -I/opt/local/include   -fPIC  -I/opt/local/include -I/Developer/Headers/FlatCarbon  -I/opt/local/include -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-long-long -O2 -I/Developer/Headers/FlatCarbon -fno-strict-aliasing -fpascal-strings -fno-common -fshort-wchar -pthread -pipe  -DNDEBUG -DTRIMMED -O2 -I/opt/local/include/cairo -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include -I/opt/local/include/libpng12   -I/opt/local/include/cairo -I/opt/local/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng12   -I/opt/local/include/gtk-2.0 -I/opt/local/lib/gtk-2.0/include -I/opt/local/include/atk-1.0 -I/opt/local/include/cairo -I/opt/local/include/pango-1.0 -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include -I/opt/local/include/pixman-1 -I/opt/local/include/freetype2 -I/opt/local/include/libpng12 -I/opt/local/include/gtk-unix-print-2.0   -I/opt/local/include/pango-1.0 -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include -I/opt/local/include/freetype2    -I/opt/local/include -I/Developer/Headers/FlatCarbon  -I/opt/local/include -DMOZILLA_CLIENT -include ../../../mozilla-config.h -Wp,-MD,.deps/gfxPlatformGtk.pp gfxPlatformGtk.cpp
../../../dist/include/thebes/gfxPangoFonts.h:61: warning: 'FcPattern': visibility attribute ignored because it
/opt/local/include/fontconfig/fontconfig.h:224: warning: conflicts with previous declaration here
../../../dist/include/thebes/gfxPattern.h:48: warning: 'cairo_pattern_t': visibility attribute ignored because it
/opt/local/include/cairo/cairo.h:182: warning: conflicts with previous declaration here
../../../dist/include/thebes/gfxPath.h:44: warning: 'cairo_path_t': visibility attribute ignored because it
/opt/local/include/cairo/cairo.h:1816: warning: conflicts with previous declaration here
../../../dist/include/thebes/gfxContext.h:52: warning: 'cairo_t': visibility attribute ignored because it
/opt/local/include/cairo/cairo.h:120: warning: conflicts with previous declaration here
/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MachineExceptions.h:255: error: declaration does not declare anything
gfxPlatformGtk.cpp:89: warning: 'gfxPlatformGtk::sDPI': visibility attribute ignored because it
../../../dist/include/thebes/gfxPlatformGtk.h:140: warning: conflicts with previous declaration here
gfxPlatformGtk.cpp:90: warning: 'gfxPlatformGtk::sFontconfigUtils': visibility attribute ignored because it
../../../dist/include/thebes/gfxPlatformGtk.h:141: warning: conflicts with previous declaration here
gmake[5]: *** [gfxPlatformGtk.o] Error 1
gmake[5]: Leaving directory `/opt/local/var/macports/build/_Users_jeremy_src_macports-trunk_dports_www_firefox-x11/work/mozilla-1.9.1/gfx/thebes/src'
gmake[4]: *** [libs] Error 2


Reproducible: Always

Actual Results:  
/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MachineExceptions.h:
typedef unsigned char                   FPRegIntel[10];
struct FPUInformationIntel {
  FPRegIntel          Registers[8];
  unsigned short      Control;
  unsigned short      Status;     // Line 255
  unsigned short      Tag;
  unsigned short      Opcode;
  unsigned int        EIP;
  unsigned int        DP;
  unsigned int        DS;
};

Here's what the preprocessor does with this struct:

typedef unsigned char FPRegIntel[10];
struct FPUInformationIntel {
  FPRegIntel Registers[8];
  unsigned short Control;
  unsigned short int;       // So it looks like there's a #define Status int somewhere mucking this up
  unsigned short Tag;
  unsigned short Opcode;
  unsigned int EIP;
  unsigned int DP;
  unsigned int DS;
};
typedef struct FPUInformationIntel FPUInformationIntel;


Expected Results:  
Don't #define Status int.  Use a typedef
Product: Firefox → Core
QA Contact: general → general
I can no longer reproduce this... not sure why it went away, but closing for now...
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → WORKSFORME
Ok, I wasn't reproducing it because I was working on my ppc box for a while... this issue occurs on intel.
Status: RESOLVED → UNCONFIRMED
Resolution: WORKSFORME → ---
Assignee: nobody → jeremyhu
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
This is a bug in X, not Mozilla:

X11/extensions/XKBsrv.h 

#define	Status		int
#define	XPointer	pointer
#define	Display		struct _XDisplay
Here's a workaround for the build issue
Attachment #371561 - Flags: review?(benjamin)
Component: General → GFX: Thebes
QA Contact: general → thebes
You're going to be in for a world of hurt if you're trying to build on OSX with Gtk.. it can work, see bug 414490, but there's a lot of internal cleanup that would need to happen.
Thanks for your concern Vlad, but i'm running 3.1b3 on Darwin/X11/gtk right now.  Yes, there is a lot of internal cleanup, and this bug is a small part of it.

See:  http://trac.macports.org/browser/trunk/dports/www/firefox-x11-devel/Portfile
Comment on attachment 371561 [details] [diff] [review]
workaround for the build failure

I think this is fine, but a gfx peer should look at it.
Attachment #371561 - Flags: review?(benjamin) → review?(vladimir)
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/d161d5bc6a28
Status: ASSIGNED → RESOLVED
Closed: 15 years ago15 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.2a1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: