Last Comment Bug 659825 - [10.7 SDK] Conflicting definitions of NS_DEPRECATED
: [10.7 SDK] Conflicting definitions of NS_DEPRECATED
Product: Core
Classification: Components
Component: XPCOM (show other bugs)
: Trunk
: x86_64 Mac OS X
: -- normal (vote)
: mozilla7
Assigned To: Jesse Ruderman
: Nathan Froyd [:froydnj]
Depends on:
Blocks: 661638
  Show dependency treegraph
Reported: 2011-05-25 17:10 PDT by Jesse Ruderman
Modified: 2011-06-11 06:44 PDT (History)
8 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

rename NS_DEPRECATED to MOZ_DEPRECATED (3.99 KB, patch)
2011-05-25 17:13 PDT, Jesse Ruderman
Pidgeot18: review+
benjamin: superreview+
Details | Diff | Splinter Review
patch v2 (4.21 KB, patch)
2011-06-07 14:24 PDT, Jesse Ruderman
jruderman: review+
jruderman: superreview+
Details | Diff | Splinter Review

Description User image Jesse Ruderman 2011-05-25 17:10:03 PDT
Trying to compile Firefox on Lion, after working around bug 659817 (with a local backout) and bug 655339 (with bug 655339 comment 21).

> The following command failed to execute properly:
> g++-4.2 -o nsDragService.o -c -fvisibility=hidden -DXPCOM_TRANSLATE_NSGM_ENTRY_POINT=1 -DMOZILLA_INTERNAL_API -D_IMPL_NS_COM -DEXPORT_XPT_API -DEXPORT_XPTC_API -D_IMPL_NS_GFX -D_IMPL_NS_WIDGET -DIMPL_XREAPI -DIMPL_NS_NET -DIMPL_THEBES -DSTATIC_EXPORTABLE_JS_API -DOSTYPE="Darwin11.0.0" -DOSARCH=Darwin -DNO_X11 -I/Users/jruderman/mozilla-central/widget/src/cocoa/../xpwidgets -I/Users/jruderman/mozilla-central/widget/src/cocoa -I. -I../../../dist/include -I../../../dist/include/nsprpub -I/Users/jruderman/mozilla-central/obj-ff-dbg-64/dist/include/nspr -I/Users/jruderman/mozilla-central/obj-ff-dbg-64/dist/include/nss -fPIC -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-variadic-macros -Werror=return-type -fno-strict-aliasing -fno-common -fshort-wchar -pthread -DNO_X11 -pipe -DDEBUG -D_DEBUG -DTRACING -g -DMOZILLA_CLIENT -include ../../../mozilla-config.h -MD -MF .deps/nsDragService.pp -fobjc-exceptions /Users/jruderman/mozilla-central/widget/src/cocoa/
> In file included from ../../../dist/include/nsCoord.h:41,
>                  from ../../../dist/include/nsRect.h:43,
>                  from /Users/jruderman/mozilla-central/widget/src/cocoa/../xpwidgets/nsBaseWidget.h:40,
>                  from /Users/jruderman/mozilla-central/widget/src/cocoa/nsCocoaWindow.h:47,
>                  from /Users/jruderman/mozilla-central/widget/src/cocoa/
> ../../../dist/include/nscore.h:261:1: warning: "NS_DEPRECATED" redefined
> In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:8,
>                  from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12,
>                  from /Users/jruderman/mozilla-central/widget/src/cocoa/nsCocoaWindow.h:45,
>                  from /Users/jruderman/mozilla-central/widget/src/cocoa/
> /System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:165:1: warning: this is the location of the previous definition

Our NS_DEPRECATED was added in bug 414063. Apple's NS_DEPRECATED is being added in Mac OS X 10.7.
Comment 1 User image Jesse Ruderman 2011-05-25 17:13:18 PDT
Created attachment 535238 [details] [diff] [review]
Comment 2 User image Steven Michaud [:smichaud] (Retired) 2011-05-26 11:47:40 PDT
I suspect this bug only happens if you either use the 10.7 SDK or
don't specify an SDK (which would make the build use currently
installed system files).

In any case, I'm not able to reproduce it when I use the 10.6 SDK
("ac_add_options --with-macos-sdk=/Developer/SDKs/MacOSX10.6.sdk"),
doing either a 32-bit or a 64-bit build.

Currently we default (on the trunk) to using the 10.5 SDK to do 32-bit
builds, and the 10.6 SDK to do 64-bit builds -- the 32-bit binaries
need to support OS X 10.5 and up, and the 64-bit binaries need to
support OS X 10.6 and up.

XCode 4.1 for OS X 10.7 doesn't have a 10.5 SDK.  So it'll be a while
before we can use it to do any kind of official build (even
nightlies).  And it'll be even longer before we can use the 10.7 SDK
on OS X 10.7.

We'll need to deal with this bug eventually, but it can't be
considered a blocker.
Comment 3 User image Stefan Arentz [:st3fan] 2011-05-30 19:32:36 PDT
Just confirming that this patch works well for me. I was able to build against the 10.7 SDK without NS_DEPRECATED problems.
Comment 4 User image Daniel Holbert [:dholbert] 2011-06-07 11:34:09 PDT
Attached patch has neither author name nor commit message - Jesse, could you add those before putting this up as checkin-needed? :)
Comment 5 User image Jesse Ruderman 2011-06-07 14:24:29 PDT
Created attachment 537866 [details] [diff] [review]
patch v2
Comment 6 User image Dão Gottwald [:dao] 2011-06-08 00:40:02 PDT

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