Closed Bug 47419 Opened 24 years ago Closed 21 years ago

nsCRT.h conflicts with other header files

Categories

(Core :: XPCOM, defect, P3)

x86
Windows 95
defect

Tracking

()

RESOLVED WORKSFORME
mozilla1.3beta

People

(Reporter: jonsmirl, Assigned: timeless)

Details

(Keywords: helpwanted)

From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 95)
BuildID:    M16

Apache's httpd.h is defining:
#define LF 10
#define CR 13
nsCRT.h uses:
#define CR '\015'
#define LF '\012'

Microsoft's crtdbg.h redefines free as part of it's debugging support
#define   free(p)           _free_dbg(p, _NORMAL_BLOCK)
nsCRT.h has two member functions named free() that won't compile when crtdbg.h 
is in use.

Reproducible: Always
Steps to Reproduce:
include httpd.h
include crtdbg.h
include nsCRT.h

You get four compiler errors.
jonsmirl@mediaone.net - why are you trying to compile Mozilla and Apache 
together? Or is that a secret? ;-)

And do you have a proposed fix for this?

Gerv
I'm calling existing XPCOM components from an Apache module.

The work around if to undef CR, LF before including the other file.

There is no solution for the free macro so you can't use the MSVC heap debugger 
until they rename the functions. This issue has nothing to do with Apache.
Confirming for developer consideration.

Gerv
Status: UNCONFIRMED → NEW
Ever confirmed: true
malloc debugging needs to be enabled to observe the conflict:

#define _DEBUG
#define _CRTDBG_MAP_ALLOC
#include "crtdbg.h"
Updating QA Contact
QA Contact: leger → jonsmirl
Status: NEW → ASSIGNED
Target Milestone: --- → Future
Assigning rest of xpcom stuff to myself (from Ray).
Assignee: rayw → warren
Status: ASSIGNED → NEW
Target Milestone: Future → mozilla1.0
reasigning warren bugs to default component owners.
Assignee: warren → kandrot
QA Contact: jonsmirl → scc
Target Milestone: mozilla1.0 → ---
reassign all kandrot xpcom bug.
Assignee: kandrot → dougt
Keywords: helpwanted
Target Milestone: --- → Future
Jon, do you think that you can attach a patch :-)
so this bug only involves #undef'ing CR and LF, right?
i fixed the cr/lf thing shortly after this bug was filed (see cvs blame).

i'm having trouble verifying that the other issue is actually a problem (using
TestDeque.cpp, msvc6 and a small little |class test{void foo(void*)}; void
foo(void*){}| since i decided to try building xpcom w/ the modified nsCRT.h),
but the fix would be to change |free| to |(free)|.

i'd like to resolve this as WFM. reporter: is this still a problem?

i'm setting a target milestone, if there is no response before that milestone
passes, then anyone is welcome to resolve this bug as WFM.
Assignee: dougt → timeless
Target Milestone: Future → mozilla1.3beta
> comment #11
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.