bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch: Windows Platform SDK - IPv6 - Borland C++ Builder 6.0 - Windows 2


From: Conrad T. Pino
Subject: Patch: Windows Platform SDK - IPv6 - Borland C++ Builder 6.0 - Windows 2000
Date: Mon, 29 Aug 2005 02:22:31 -0700

Hi David,

> From: David Sugar
> Sent: Thursday, August 25, 2005 13:52
> To: Conrad T. Pino
> Cc: Bug Common C++
> Subject: Re: Windows Platform SDK - IPv6 - Borland C++ Builder 6.0 -
> Windows 2000
> 
> Yes, ipv6 and platformsdk have an odd entanglement at the moment.  The 
> default I choose, actually, of having platformsdk defined, was in large 
> part because this matched what osip/exosip also required.  The ipv6 
> entanglements only made the problem harder.

I believe a patch along these lines solves the entanglement problem.

Index: include/cc++/address.h
===================================================================
RCS file: /cvsroot/gnutelephony/testing/commoncpp2/include/cc++/address.h,v
retrieving revision 1.2
diff -u -p -r1.2 address.h
--- include/cc++/address.h      13 Jun 2005 17:04:03 -0000      1.2
+++ include/cc++/address.h      29 Aug 2005 05:27:43 -0000
@@ -43,6 +43,10 @@
 #ifndef        CCXX_ADDRESS_H_
 #define        CCXX_ADDRESS_H_
 
+#ifndef CCXX_CONFIG_H_
+#include <cc++/config.h>
+#endif
+
 #ifndef        CCXX_MISSING_H_
 #include <cc++/missing.h>
 #endif
@@ -55,11 +59,6 @@
 #include <cc++/exception.h>
 #endif
 
-#if defined(WIN32) && !defined(__CYGWIN32__)
-#define        __WINSOCK__
-#include <winsock2.h>
-#endif
-
 #ifdef CCXX_NAMESPACES
 namespace ost {
 #endif
Index: src/network.cpp
===================================================================
RCS file: /cvsroot/gnutelephony/testing/commoncpp2/src/network.cpp,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 network.cpp
--- src/network.cpp     23 Apr 2005 22:08:23 -0000      1.1.1.1
+++ src/network.cpp     29 Aug 2005 05:27:44 -0000
@@ -58,9 +58,6 @@
 #ifdef HAVE_NET_IF_H
 #include <net/if.h>
 #endif
-#else
-#include <winsock2.h>
-#include <ws2tcpip.h>
 #endif
 
 #ifdef CCXX_NAMESPACES
@@ -68,7 +65,7 @@ namespace ost {
 #endif
 
 #if defined(HAVE_NET_IF_H) || defined(WIN32)
-#if !defined(_MSC_VER) || _MSC_VER >= 1300 || defined(HAVE_PLATFORMSDK)
+#if !defined(_MSC_VER) || _MSC_VER >= 1300
 
 using namespace std;
 
Index: w32/cc++/config.h
===================================================================
RCS file: /cvsroot/gnutelephony/testing/commoncpp2/w32/cc++/config.h,v
retrieving revision 1.3
diff -u -p -r1.3 config.h
--- w32/cc++/config.h   13 Jul 2005 15:29:59 -0000      1.3
+++ w32/cc++/config.h   29 Aug 2005 09:15:53 -0000
@@ -78,44 +78,73 @@
 * @todo Why may be need using kernel object Mutex as a background for 
ost::Mutex?
 */
 
-/**
- * Determine if platform SDK is installed.  Comment this line out
- * if using VS6 without any Platform SDK updates...
- */
-#define        HAVE_PLATFORMSDK
-
-/**
- * Some sanity checks for platformsdk support based on build env.
- */
-
-#ifndef        HAVE_PLATFORMSDK
-#if defined(_MSC_VER) && _MSC_VER >= 1300
-#define        HAVE_PLATFORMSDK
-#else
-#if defined(__MINGW32__) || defined(__CYGWIN32__)
-#undef HAVE_PLATFORMSDK
-#endif
-#endif
-#endif
-
 // Select the way, that the ost::Mutex based on.
 //#define MUTEX_UNDERGROUND_WIN32_MUTEX
 #define MUTEX_UNDERGROUND_WIN32_CRITICALSECTION
 
-// Require for compiling with critical sections.  
+/*
+http://msdn.microsoft.com/library/en-us/winprog/winprog/using_the_windows_headers.asp
+
+Minimum system required    Macros to define 
+
+Windows "Longhorn"         _WIN32_WINNT >= 0x0600
+                           WINVER >= 0x0600
+ 
+Windows Server 2003        _WIN32_WINNT> = 0x0502
+                           WINVER >= 0x0502
+ 
+Windows XP                 _WIN32_WINNT >= 0x0501
+                           WINVER >= 0x0501
+ 
+Windows 2000               _WIN32_WINNT >= 0x0500
+                           WINVER >= 0x0500
+ 
+Windows NT 4.0             _WIN32_WINNT >= 0x0400
+                           WINVER >= 0x0400
+ 
+Windows Me                 _WIN32_WINDOWS >= 0x0500
+                           WINVER >= 0x0500
+ 
+Windows 98                 _WIN32_WINDOWS >= 0x0410
+                           WINVER >= 0x0410
+ 
+Windows 95                 _WIN32_WINDOWS >= 0x0400
+                           WINVER >= 0x0400
+
+Faster Builds with Smaller Header Files
+
+WIN32_LEAN_AND_MEAN
+*/
+ 
+// Require for compiling with critical sections.
+#ifndef _WIN32_WINNT
 #define _WIN32_WINNT 0x0400
+#endif
 
-#if    !defined(HAVE_PLATFORMSDK)
-#include <windows.h>
+// Make sure we're consistent with _WIN32_WINNT
+#ifndef WINVER
+#define WINVER _WIN32_WINNT
 #endif
+
+#ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN
+#define _CCXX_WIN32_LEAN_AND_MEAN_
+#endif
+
 #include <winsock2.h>
 #include <ws2tcpip.h>
-#if defined(HAVE_PLATFORMSDK)
-#include <windows.h>
-#define CCXX_IPV6
+
+#ifdef _CCXX_WIN32_LEAN_AND_MEAN_
+#undef WIN32_LEAN_AND_MEAN
+#undef _CCXX_WIN32_LEAN_AND_MEAN_
 #endif
+
+#if _WIN32_WINNT >= 0x0501
+#define CCXX_IPV6
 #endif
 
+#endif /* #ifndef CCXX_WIN32 */
+
 #ifdef WIN32
 #ifndef ssize_t
 #define ssize_t int
@@ -168,9 +197,9 @@ typedef unsigned long long uint64;
 # ifndef ETC_PREFIX
 #   define ETC_PREFIX   "c:/"
 # endif
-#else
+#else /* #ifndef __MINGW32__ */
 typedef DWORD size_t;
-#endif
+#endif /* #ifndef __MINGW32__ */
 
 #else /* !defined(__MINGW32__) && !defined(__CYGWIN32__) */
 
@@ -235,7 +264,7 @@ typedef unsigned __int64 uint64;
 #define        ETC_PREFIX "c:/"
 #endif
 
-#endif
+#endif /* !defined(__MINGW32__) && !defined(__CYGWIN32__) */
 
 // have exceptions
 #ifdef CCXX_NO_EXCEPTIONS
@@ -258,8 +287,7 @@ typedef unsigned __int64 uint64;
 #define        HAVE_LOCALTIME_R
 #endif
 
-
-#endif
+#endif /* #ifndef CCXX_CONFIG_H_ */
 
 /** EMACS **
  * Local variables:




reply via email to

[Prev in Thread] Current Thread [Next in Thread]