Closed
Bug 65727
Opened 24 years ago
Closed 22 years ago
Change from XP_PC to XP_WIN
Categories
(Core :: XPCOM, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: jonsmirl, Assigned: dveditz)
Details
(Keywords: helpwanted)
Attachments
(2 files)
515 bytes,
patch
|
Details | Diff | Splinter Review | |
1.20 KB,
patch
|
Details | Diff | Splinter Review |
Could nscom.h be changed to generate a compiler error if XP_PC is used?
I recompiled an older standalone XPCOM project that had XP_PC defined. It took
me two days of debugging to figure out what happen.
Having XP_PC defined instead of XP_WIN causes __stdcall to be dropped from
Add/Release calls. So everything compiles and links just fine but the app will
give stack imbalance errors when run. In the user app the calls to Add/Release
() have been compiled as __thiscall instead of __stdcall since XP_WIN was not
defined.
This is very difficult to find since all of the souce code looks correct when
viewed in the debugger. Only after looking at the disassembled code could I see
the missing push of the this pointer and finally figure out what happened.
Comment 1•24 years ago
|
||
Looking for an appropriate owner for this bug. We'll start the hunt with
Kandrot, though this may not be right. Let's discuss and figure out who best
serves this fix.
Assignee: scc → kandrot
Comment 2•24 years ago
|
||
David, this is the bug we discussed. If it's in your power to resolve this bug,
you should do it ... else you should reassign it to dveditz (now cc'd). There
is some relation to bug #56767, currently assigned to leaf, I think. cc'ing him
as well.
Assignee: kandrot → dprice
if no one minds, i'm sure i could put an error generator in nscom.h
Keywords: helpwanted
Comment 4•24 years ago
|
||
fyi XP_PC is usedin lots of places in the code. Removing it will require
changing XP_PC to XP_WIN
Could the test be requiring XP_PC and XP_WIN|XP_OS2? XP_PC without one of those
two would generate an error.
Comment 6•24 years ago
|
||
handing this to dveditz, I'm not the right man for the job.
Dave
Assignee: dprice → dveditz
Comment 7•24 years ago
|
||
We keep seeing newsgroup postings from people who don't know why their VC
project built binaries either don't build or don't run. Invariably they've
failed to define XP_WIN so the xpcom method calls are declared w/o _stdcall and
they're screwed.
I propose that we simply detect that condition and make it an #error for those
people to fix on their own rather than them being baffled and *maybe* asking for
unspecified help.
I think it is better to #error than to #define XP_WIN for them because we don't
know if #defining it in the code in one place rather than in the build system
(as the mozilla system does) won't cause some subtle and obscured error. Let's
force them to do things right.
I'll attach a patch.
Comment 8•24 years ago
|
||
Comment 9•24 years ago
|
||
Looking for r= and sr= Let's just check this in and stop seeing all the
postings from confused folks.
Comment 10•24 years ago
|
||
r=valeski
Comment 11•24 years ago
|
||
sr=scc
Comment 12•24 years ago
|
||
I (finally) checked in my patch. This should deal with the immediate problem of
helping people not stumble into this hole. So, is someone really going to go
through and do the Right Thing here or should this be marked WONTFIX or futured
or what?
Comment 13•24 years ago
|
||
It turns out XP_WIN32 is needed alongside XP_WIN.
news://news.mozilla.org/9m626l%24od81%40secnews.netscape.com
http://lxr.mozilla.org/seamonkey/search?string=XP_WIN32
I'll add a new patch for nsCom.h to help people find that error - with a comment
to help them figure out what the #error means.
Comment 14•24 years ago
|
||
Comment 15•23 years ago
|
||
I checked in that last patch.
Comment 16•23 years ago
|
||
Of course my patch broke the NS commercial tree where XP_WIN32 was not
#define'd. I talked it over with vidur and decided to add it to ns/config/WIN32
(XP_WIN32 does not show up anywhere in the NS commercial tree, so this should
not matter otherwise).
Fixing this bug ought to include consolidating XP_WIN and XP_WIN32. I think
we've lost the reason for this distinction (though I see we still uses of
XP_WIN16!).
http://lxr.mozilla.org/seamonkey/search?string=XP_WIN16
http://lxr.mozilla.org/seamonkey/search?string=XP_WIN32
Assignee | ||
Updated•23 years ago
|
Status: NEW → ASSIGNED
Comment 17•22 years ago
|
||
Except for NSPR & NSS, XP_PC has been removed from the mozilla tree (bug 56767).
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•