stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <>
Subject Re: missprint in include/rw/_mutex.h ?
Date Fri, 10 Aug 2007 18:25:03 GMT
Travis Vitek wrote:
> Well, as it stands the macro is doing exactly what its name indicates it
> will do. If it is defined, the implementation will not use forward
> declarations of the critical section struct and its functions.
> I agree that this is a little weird because the default will be for the
> macro to not be defined. The user has to define
> _RWSTD_NO_FWD_DECLARATIONS to get the declarations from the correct and
> normal place [windows.h].

The purpose of the forward declarations is to avoid dragging
in the quarter million lines of code that #include <windows.h>
pulls in to the translation unit. The <windows.h> may be the
correct header to #include but the way it's implemented makes
it horribly inefficient to compile and introduces namespace
pollution on an unprecedented scale (hence Microsoft's own
hacks like VC_EXTRALEAN and WIN32_LEAN_AND_MEAN -- even they
recognize what a mess it is).

I have for a long time been meaning to hide all the preprocessor
ugliness in _mutex.h in a .cpp file and provide a clean interface
to the APIs it defines. I don't think it's too hard to do but like
with all other nice but non-essential projects like this, I haven't
had time to do it. If you feel adventurous and would like to take
a crack at it, be my guest :)

> It seems to me that the macro should be
> _RWSTD_NO_INCLUDE_WINDOWS_H or something similar.

Yeah, I agree, it's not the best name. Now that we have a config
test to determine the signature of the InterlockedXxx functions
and given that the signatures have been stable for some time now
the macro most likely isn't even needed anymore.


> Travis
>> -----Original Message-----
>> From: Farid Zaripov [] 
>> Sent: Friday, August 10, 2007 6:58 AM
>> To:
>> Subject: missprint in include/rw/_mutex.h ?
>>  Below is a part of the include/rw/_mutex.h file, line 116:
>> ----------- 
>> #    include <windows.h>
>> #  else   // if defined (_RWSTD_NO_FWD_DECLARATIONS)
>>   // avoid #including this header (MFC doesn't like it)
>>   // #  include <windows.h>
>> ----------- 
>>  Perhaps there in the first line should be #ifndef instead of #ifdef ?
>> Farid.

View raw message