programs: Fix broken compilation on win64

Maarten Lankhorst maarten at codeweavers.com
Thu Nov 27 16:43:31 CST 2008


Hi Rob,

Rob Shearman schreef:
> 2008/11/27 Maarten Lankhorst <maarten at codeweavers.com>:
>   
>> ---
>> Set the Spare[0] at runtime after a critical section is entered. :-)
>>
>> I'm not testing Spare[0] at all calls to EnterCriticalSection, but if this
>> is a problem I will send a revised patch
>>     
>
> IMHO, this is too fragile. My solution would be two macros: one for
> declaring a variable storing the name for a critical section, and a
> second for putting that name into the critical section structure. The
> latter would be something like the following for 64-bit:
> #define WINE_DEBUG_USE_CRIT_SECT_NAME(name)  { (DWORD)(DWORD_PTR)name,
> (DWORD)((DWORD_PTR)name >> 32) }
>
> It might even be better to let the macro fill in / declare the entire
> CRITICAL_SECTION_DEBUG stucture.
>   
If you can do that without compile errors you'll be my hero. I couldn't 
get that done, I tried..

Cheers,
Maarten.



More information about the wine-devel mailing list