Closed Bug 374563 Opened 17 years ago Closed 17 years ago

MSVC preprocessor generates non distributable/compilable code from mozilla files

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: themystic.ca, Assigned: themystic.ca)

Details

Attachments

(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 http://zenit.senecac.on.ca/index.php/Distcc_With_MSVC.
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]
patch

>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

done

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

done

Assignee: general → themystic.ca
Status: NEW → RESOLVED
Closed: 17 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.

Attachment

General

Creator:
Created:
Updated:
Size: