Bug 39888 - misc/win32/apr_app.c and others include crtdbg.h on WinCE
Summary: misc/win32/apr_app.c and others include crtdbg.h on WinCE
Status: RESOLVED FIXED
Alias: None
Product: APR
Classification: Unclassified
Component: APR (show other bugs)
Version: HEAD
Hardware: Other Windows CE
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache Portable Runtime bugs mailinglist
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2006-06-23 16:57 UTC by Curt Arnold
Modified: 2007-05-31 19:47 UTC (History)
0 users



Attachments
Add APR_HAVE_CRTDBG_H macro (2.67 KB, patch)
2006-06-23 17:02 UTC, Curt Arnold
Details | Diff
Much simpler patch (460 bytes, patch)
2007-05-02 11:56 UTC, Curt Arnold
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Curt Arnold 2006-06-23 16:57:34 UTC
misc/win32/apr_app.c, internal.c, misc.c and start.c include crtdbg.h and call
_malloc_dbg and _realloc_dbg which provide debugging versions of malloc and
realloc respectively.  crtdbg.h is not available on WinCE (as well on gcc or
Borland builds as reported in bug 33490).

The attach patch defines a macro APR_HAVE_CRTDBG_H in apr.hw which is set to 0
for WinCE and 1 otherwise.  include/arch/win32/apr_private.h adds macros for
_malloc_dbg and _realloc_dbg which drop the extra arguments and calls malloc and
realloc respectively.

The includes of "crtdbg.h" are guarded by a check of APR_HAVE_CRTDBG_H.

The patch doesn't fix the problem with the Borland or gcc's, but all that is
needed is to set APR_HAVE_CRTDBG_H appropriately.
Comment 1 Curt Arnold 2006-06-23 17:02:59 UTC
Created attachment 18523 [details]
Add APR_HAVE_CRTDBG_H macro
Comment 2 William A. Rowe Jr. 2006-09-19 19:54:35 UTC
Mass reassign the 44 open apr-bugs to apr bug list
Comment 3 Davi Arnaut 2007-04-29 15:24:51 UTC
There were a few conflicts, otherwise it compiles and builds fine on VS C++ 6.0
Comment 4 Curt Arnold 2007-05-02 11:56:59 UTC
Created attachment 20111 [details]
Much simpler patch

The underlying issue has been addressed since the original patch was filed by
using macros defined include/arch/win32/apr_arch_misc.h to replace calls to the
crtdbg malloc variants.  The only thing missing was to also avoid using the
crtdbg variants when building for Windows CE.
Comment 5 William A. Rowe Jr. 2007-05-31 19:47:43 UTC
Marking fixed, feel free to roll up a single patch with this change and the
others if you would like these applied to 1.2 or 0.9.

Committed to trunk r543371.