MSVC preprocessor generates non distributable/compilable code from mozilla files

RESOLVED FIXED

Status

()

Core
DOM
RESOLVED FIXED
11 years ago
11 years ago

People

(Reporter: Tom Aratyn, Assigned: Tom Aratyn)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

11 years ago
Created attachment 259058 [details] [diff] [review]
patch

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.
(Assignee)

Comment 1

11 years ago
It should be noted that the attached patch was written half by me and half by Cesar Oliveira.

Updated

11 years ago
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+
(Assignee)

Comment 3

11 years ago
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.
(Assignee)

Comment 4

11 years ago
Created attachment 259087 [details] [diff] [review]
same patch but no change to NS_IMETHOD_(type) macro.
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
Last Resolved: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.