Discussion:
[omniORB] Announce: omniORB 4.1.0 and omniORBpy 3.0 releasecandidates
Barthel Marco
2006-10-05 19:43:22 UTC
Permalink
We encounter some problems compiling omniORB 4.1.0 RC1 using WIN32/SDK
Feb 2003 and MSVC6:


corbaOrb.cc
..\..\..\..\include\omniORB4\internal\libcWrapper.h(110) : warning
C4005: 'WIN32_LEAN_AND_MEAN' : macro redefinition
unknown(0) : see previous definition of 'WIN32_LEAN_AND_MEAN'
C:\BM\Progs\MS_SDK\Include\winsock2.h(1283) : error C2371: 'sockaddr_in'
: redefinition; different basic types
C:\BM\Progs\MS_SDK\Include\winsock2.h(397) : see declaration of
'sockaddr_in'
cl -c -O2 -MT -GX -Z7 -D_WINSTATIC -I.. -I.\..
-I..\..\..\..\include\omniORB4\internal -DUSE_omniORB_logStream
-D_OMNIOR
B_LIBRARY -DOMNIORB_VERSION_STRING=\"4.1.0\"
-DOMNIORB_VERSION_HEX=0x040100C1
-DCONFIG_DEFAULT_LOCATION=\"C:\\OMNIORB.CF
G\" -DCONFIG_ENV=\"OMNIORB_CONFIG\" -DNTArchitecture -I. -I.
-I..\..\..\..\include -D__WIN32__ -D_WIN32_WINNT=0x0400 -DW
IN32_LEAN_AND_MEAN -D__x86__ -D__NT__ -D__OSVERSION__=4
-Fostatic\corbaOrb.o -TpcorbaOrb.cc
make[3]: *** [static/corbaOrb.o] Error 2


When we compile using MSVC6 + all service packs applied there is no
problem.


I tracked down the problem to the redefinition of "sockaddr_in"

#define SOCKADDR_STORAGE sockaddr_in --> typedef struct
sockaddr_storage SOCKADDR_STORAGE;


Why is there a "#define SOCKADDR_STORAGE" on WIN32?? This seems to be
defined by winsock.h

-marco




#####################
From winsock2.h SDK FEB 2003
/*
* Socket address, internet style.
*/
struct sockaddr_in {
short sin_family;
u_short sin_port;
struct in_addr sin_addr;
char sin_zero[8];
};


typedef struct sockaddr_storage SOCKADDR_STORAGE;
typedef struct sockaddr_storage *PSOCKADDR_STORAGE;
typedef struct sockaddr_storage FAR *LPSOCKADDR_STORAGE;

#####################
From oo41
#if defined(_MSC_VER) && _MSC_VER >= 1300 // VC++ 7 or greater
# define HAVE_GETADDRINFO 1
# define HAVE_GETNAMEINFO 1
# define HAVE_STRUCT_SOCKADDR_IN6 1
# define HAVE_STRUCT_SOCKADDR_STORAGE 1
#endif

#####################
From oo41
////////////////////////////////////////////////////////////////////////
// Platform feature selection

#if !defined(OMNI_DISABLE_IPV6) && defined(HAVE_STRUCT_SOCKADDR_IN6) &&
defined(HAVE_STRUCT_SOCKADDR_STORAGE) && defined(HAVE_GETADDRINFO) &&
defined(HAVE_GETNAMEINFO)
# define OMNI_SUPPORT_IPV6
# define SOCKADDR_STORAGE sockaddr_storage
#else
# define SOCKADDR_STORAGE sockaddr_in
#endif
Duncan Grisby
2006-10-09 19:25:49 UTC
Permalink
Post by Barthel Marco
We encounter some problems compiling omniORB 4.1.0 RC1 using WIN32/SDK
[...]
Post by Barthel Marco
C:\BM\Progs\MS_SDK\Include\winsock2.h(1283) : error C2371: 'sockaddr_in'
: redefinition; different basic types
C:\BM\Progs\MS_SDK\Include\winsock2.h(397) : see declaration of
'sockaddr_in'
[...]
Post by Barthel Marco
I tracked down the problem to the redefinition of "sockaddr_in"
#define SOCKADDR_STORAGE sockaddr_in --> typedef struct
sockaddr_storage SOCKADDR_STORAGE;
Why is there a "#define SOCKADDR_STORAGE" on WIN32?? This seems to be
defined by winsock.h
omniORB is using the define to either resolve to sockaddr_storage or
sockaddr_in, depending on whether the platform defines sockaddr_storage
or not. Unfortunately, the Windows headers are also using
SOCKADDR_STORAGE in capitals. I've changed omniORB to call it
OMNI_SOCKADDR_STORAGE, so it should be ok now.

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Loading...