include/msvcrt/crtdbg.h

Boaz Harrosh wine at electrozaur.com
Tue Jul 19 11:06:45 CDT 2005


Saulius Krasuckas wrote:

>It seems I was too in hurry.  Some comments follows.
>
>
>* On Tue, 19 Jul 2005, Saulius Krasuckas wrote:
>  
>
>>int       <->  long int.
>>void (*)  <->  void (__cdecl *_CRT_DUMP_CLIENT) (void *, size_t)
>>    
>>
>
>I mean differences between native version and a Wine's one.
>
>  
>
>>Then I see all the declared function are defined to be non-operational:
>>
>>| #endif /* _DEBUG */
>>| 
>>| #define _CrtCheckMemory()               ((int)1)
>>| #define _CrtDbgReport(...)              ((int)0)
>>| #define _CrtDoForAllClientObjects(f,c)  ((void)0)
>>| #define _CrtDumpMemoryLeaks()           ((int)0)
>>    
>>
>
>These are defined in the Wine tree.  They are out of the #ifndef _DEBUG - 
>#else - #endif statement, so they make inclusion of a header file 
>impossible.
>
>Definitions should be transfered into two parts:  operational (_DEBUG 
>defined) and non operational (no _DEBUG defined).  Right?
>
>  
>
>>Yet then I see lots of declared functions are prefixed with __cdecl and 
>>_CRTIMP prefixes.
>>    
>>
>  ...
>  
>
>>| #define _CRTIMP __declspec(dllimport)
>>    
>>
>
>And that comes from native header file.  Should we do the same in the Wine 
>header?
>
>Maybe someone is working on this already?
>
>
>  
>
  Not many apps (source code) use these functions. Mainly MFC and 
ATL/WTL and derived applications.
If it is the later case (MFC/ATL) than one can just get native header 
together with where he gut MFC/ATL from, and just make sure that it is 
in a folder with higher precedence than wine's. It will compile.
  If your code can make do without MFC/ATL and only thing missing is CRT 
memory debugging tools, than you can go head and implement them. (Or use 
native msvcrtd.dll which is of the same license as crtdebug.h. Debug 
version is of a different license than release)
  What I've seen done by people is Leave these off, as wine is doing 
now, but use other (gcc type tools) compiled into wine to debug memory 
leaks. Was that Valgrind (http://valgrind.org/) or something? See list 
archives for instructions how to use it.

Free Life
Boaz




More information about the wine-devel mailing list