nsCRT.h conflicts with other header files

RESOLVED WORKSFORME

Status

()

P3
normal
RESOLVED WORKSFORME
19 years ago
15 years ago

People

(Reporter: jonsmirl, Assigned: timeless)

Tracking

({helpwanted})

Trunk
mozilla1.3beta
x86
Windows 95
helpwanted
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

19 years ago
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
(Reporter)

Comment 2

18 years ago
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
(Reporter)

Comment 4

18 years ago
malloc debugging needs to be enabled to observe the conflict:

#define _DEBUG
#define _CRTDBG_MAP_ALLOC
#include "crtdbg.h"

Comment 5

18 years ago
Updating QA Contact
QA Contact: leger → jonsmirl

Updated

18 years ago
Status: NEW → ASSIGNED
Target Milestone: --- → Future

Comment 6

18 years ago
Assigning rest of xpcom stuff to myself (from Ray).
Assignee: rayw → warren
Status: ASSIGNED → NEW
Target Milestone: Future → mozilla1.0

Comment 7

18 years ago
reasigning warren bugs to default component owners.
Assignee: warren → kandrot
QA Contact: jonsmirl → scc
Target Milestone: mozilla1.0 → ---

Comment 8

17 years ago
reassign all kandrot xpcom bug.
Assignee: kandrot → dougt

Updated

17 years ago
Keywords: helpwanted
Target Milestone: --- → Future

Comment 9

17 years ago
Jon, do you think that you can attach a patch :-)
so this bug only involves #undef'ing CR and LF, right?
(Assignee)

Comment 11

16 years ago
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 12

15 years ago
> comment #11
Status: NEW → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.