[EMAIL PROTECTED] wrote:
Author: faridz
Date: Wed Jun 25 06:28:27 2008
New Revision: 671547
URL: http://svn.apache.org/viewvc?rev=671547&view=rev
Log:
2008-06-25 Farid Zaripov <[EMAIL PROTECTED]>
* include/rw/_mutex.h: #define WIN32_LEAN_AND_MEAN before #including
<windows.h>
to prevent #including unneeded headers, especially <winsock.h>, that
causes an
"WinSock.h has already been included" errors when <winsock2.h> has been
#included
after <rw/_mutex.h>.
I don't think we want to do this. Users might want to
#include the fat and flabby <windows.h> after they #include
one of our headers. If #undef-ining WIN32_LEAN_AND_MEAN after
#including <windows.h> here users can #include <windows.h>
again and get the rest of the junk defined there that would
be a possible solution. Otherwise we need to revert.
Martin
Modified:
stdcxx/branches/4.2.x/include/rw/_mutex.h
Modified: stdcxx/branches/4.2.x/include/rw/_mutex.h
URL:
http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/rw/_mutex.h?rev=671547&r1=671546&r2=671547&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/include/rw/_mutex.h (original)
+++ stdcxx/branches/4.2.x/include/rw/_mutex.h Wed Jun 25 06:28:27 2008
@@ -124,6 +124,10 @@
# ifdef _RWSTD_NO_FWD_DECLARATIONS
+ // prevent #including unneeded headers, i.e. <winsock.h> because
+ // this causes the error "WinSock.h has already been included"
+ // when <winsock2.h> has been included after this header
+# define WIN32_LEAN_AND_MEAN
# include <windows.h>
# define _RWSTD_MUTEX_T _RTL_CRITICAL_SECTION