Closed Bug 374563 Opened 14 years ago Closed 14 years ago

MSVC preprocessor generates non distributable/compilable code from mozilla files


(Core :: DOM: Core & HTML, defect)

Not set





(Reporter:, Assigned:



(1 file, 1 obsolete file)

Attached patch patch (obsolete) — Splinter Review
There is a problem with how the NS_IMETHOD macros are used in nsDOMScriptObjectFactory.h and nsIDOMScriptObjectFactory.h 

When the MSVC Preprocessor runs it concatenates the last characters of the macro (__stdcall)with the first characters right after the macro (GET...) resulting in something like "virtual nsISupports * __stdcallGetClassInfoInstance(nsDOMClassInfoID aID) = 0;". This does not seem to be an issue when compiling the code directly but if you first generate a preprocessed file (make nsDOMScriptObjectFactory.i) and then try to compile it, the compiler will spit out an error.

This bug needs to be fixed in order for distcc to be able to distrbiute mozilla builds. We applied the attached patch on a checked out source tree and were able to do a distributed build of mozilla using cygwin + distcc (A mingw port is under way - don't worry!). For more info see
It should be noted that the attached patch was written half by me and half by Cesar Oliveira.
Attachment #259058 - Attachment is patch: true
Attachment #259058 - Attachment mime type: text/x-patch → text/plain
Assignee: nobody → general
Component: General → DOM
OS: Windows XP → All
Product: Firefox → Core
QA Contact: general → ian
Hardware: PC → All
Comment on attachment 259058 [details] [diff] [review]

>Index: xpcom/base/nscore.h

>< #define NS_IMETHOD_(type) virtual type __stdcall
>> #define NS_IMETHOD_(type) virtual type __stdcall

This doesn't seem to change anything?
Attachment #259058 - Flags: superreview+
Attachment #259058 - Flags: review+
We tried to add a trailing white space to the macro definition to stop the problem at the source... it didn't work.

I can drop that part.
Attachment #259058 - Attachment is obsolete: true
Checked in on trunk:

Checking in ./dom/public/nsIDOMScriptObjectFactory.h;

/cvsroot/mozilla/dom/public/nsIDOMScriptObjectFactory.h,v  <--  nsIDOMScriptObjectFactory.h

new revision: 3.20; previous revision: 3.19


Checking in ./dom/src/base/nsDOMScriptObjectFactory.h;

/cvsroot/mozilla/dom/src/base/nsDOMScriptObjectFactory.h,v  <--  nsDOMScriptObjectFactory.h

new revision: 1.7; previous revision: 1.6


Assignee: general →
Closed: 14 years ago
Resolution: --- → FIXED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.