[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CommonC++ 1.6.0 Release - Compile time errors with MSVC++ 5.0/6.0 fixes.
From: |
Hoang Tran |
Subject: |
CommonC++ 1.6.0 Release - Compile time errors with MSVC++ 5.0/6.0 fixes.... |
Date: |
Thu, 20 Sep 2001 13:31:46 -0700 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Bug 1 - This is really a work around due to MSVC++ not complying to
c++ standards.
In socket.h:
#if __BYTE_ORDER == __BIG_ENDIAN
// fix the MSVC++ 5.0/6.0 problem with constant definitions
#ifdef WIN32
enum { MCAST_VALID_MASK = 0xF0000000 };
enum { MCAST_VALID_VALUE = 0xE0000000 };
#else
static const uint32 MCAST_VALID_MASK = 0xF0000000;
static const uint32 MCAST_VALID_VALUE = 0xE0000000;
#endif
#else
#ifdef WIN32
enum { MCAST_VALID_MASK = 0x000000F0 };
enum { MCAST_VALID_VALUE = 0x000000E0 };
#else
static const uint32 MCAST_VALID_MASK = 0x000000F0;
static const uint32 MCAST_VALID_VALUE = 0x000000E0;
#endif
#endif
};
Bug 2 - Even though struct in_addr has only one field, which is of
type unsigned long, MSVC++ won't allow you to just force the cast to
struct....
In inaddr.cpp
bool InetAddress::setIPAddress(const char *host)
{
if(!host)
return false;
#if defined(WIN32)
//unsigned long n_addr;
struct in_addr n_addr;
//n_addr = inet_addr(host);
n_addr.s_addr = inet_addr(host);
if ( validator )
(*validator)(n_addr);
if(n_addr.s_addr == INADDR_NONE)
return false;
*this = n_addr;
#else
struct in_addr l_addr;
int ok = inet_aton(host, &l_addr);
if ( validator )
(*validator)(l_addr);
if ( !ok )
return false;
*this = l_addr;
#endif
return true;
}
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.0.2i
iQA/AwUBO6pSLkTbQ91sJh/7EQK31ACg2cZ4UQbyVP/tit3Psd3IOaUQzhoAoL7w
5EdZp36XB8ueTQs9DZtYYs+J
=7jjx
-----END PGP SIGNATURE-----
win32_inaddr_cpp.diff
Description: Binary data
win32_socket_h.diff
Description: Binary data
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- CommonC++ 1.6.0 Release - Compile time errors with MSVC++ 5.0/6.0 fixes....,
Hoang Tran <=